Lumsdaine-Papell Unit Root Test

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

tcfoon
Posts: 54
Joined: Fri May 15, 2009 4:33 am

Re: Lumsdaine-Papell Unit Root Test

Postby tcfoon » Mon Jun 01, 2009 3:17 am

Dear Trubador,

Thank you very much for the revision code and you are really smart. The code is running well now.. Is it plausible to let me know your full name as I would like to acknowledge you when I am using the codes for my research.

Thank you,

Regards,
tcfoon
Last edited by tcfoon on Tue Sep 28, 2010 2:55 am, edited 1 time in total.

wolly77
Posts: 32
Joined: Mon Oct 05, 2009 4:28 am

Re: Lumsdaine-Papell Unit Root Test

Postby wolly77 » Mon Oct 05, 2009 4:49 am

Hi guys, I'm new in this forum. I have some problem with running the Zivot-Andrews in the code published by trubador on Jun 01 2009 (that is, the last one code which appears in this discussion). I create a group of variables and then, when I run the model, appears the following script: "Syntax error in for !kk = 1 to g.@count".
I describe my estimation problem. I want to run the Zivot-Andrews test for the following variables: pce (the dependent variable), fedf_n, ylyt, stnw, nstnw (all in log form excluding fedf_n). I run the code of trubadr, but it appears the above message of error ( "Syntax error in for !kk = 1 to g.@count"). Anyone can help me, please? Thanks ina advance.
Hi,
Davide

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Lumsdaine-Papell Unit Root Test

Postby trubador » Mon Oct 05, 2009 9:46 am

EViews codes regarding the Zivot-Andrews unit root rest under this thread are not fully functional and do not produce the desired results. Please use the following (accurate and more complete) version of the code: Zivot-Andrews Unit Root Test

donihue
Posts: 139
Joined: Wed Oct 07, 2009 8:51 am

Re: Lumsdaine-Papell Unit Root Test

Postby donihue » Sat Nov 21, 2009 5:16 am

Following up on this very helpful exchange:
Would either of you have written a code for the Clemente-Montanes-Reyes unit root test, which also alows for two structural breaks (it is implemented in Stata as "clemao" or "clemio", depending on form)?
Many thanks
Regards
Donihue

xuehe
Posts: 3
Joined: Tue Jan 12, 2010 10:13 pm

Re: Lumsdaine-Papell Unit Root Test

Postby xuehe » Tue Jan 12, 2010 11:10 pm

Dear expert:
Could you tell me how to compute critcial valure of LP test

Thanks!
Dear Trubador,

Thank you very much for the coding. I am really appreciate your help..

Warmest regards,
CF Tang

xuehe
Posts: 3
Joined: Tue Jan 12, 2010 10:13 pm

Re: Lumsdaine-Papell Unit Root Test

Postby xuehe » Tue Jan 12, 2010 11:14 pm

Dear Trubador
Could you tell me how to compute critcal value of LP test.
Best Regards
cass
joe xu

joe_3xu(at)sina.com
[quote="trubador"]I have modified your code and added a simulation exercise into the beginning. Although the following code seems to be working and identifying the structural breaks correctly, you can make all the necessary modifications and revisions for more efficient and accurate use.

Code: Select all

'Simulate a series that has two level shifts !N=10000 workfile rollingdfvalue u 1 !N series adf wfcreate u 100 !b1=17 'First break !b2=45 'Second break smpl @first !b1-1 series sy=@trend + 10*nrnd smpl !b1 !b2-1 sy = 5*@trend + 20*nrnd smpl !b2 @last sy = 7*@trend + 30*nrnd 'Apply Lumsdaine-Papell unit-root test smpl @all !trim = 0.1 'Trimming parameter !t_min = 1000 vector(2) breaks for !i = @round(@obs(sy)*!trim) to @round(@obs(sy)*(1-!trim)) for !k = !i+2 to @round(@obs(sy)*(1-!trim))-2 series DSY = D(SY) equation temp.ls DSY c SY(-1) (@trend>!i) (@trend>!i)*(@trend-!i) (@trend>!k) (@trend>!k)*(@trend-!k) DSY(-1 TO -2) if temp.@tstats(2) < !t_min then !t_min = temp.@tstats(2) breaks(1) = !i+2 'Identified first break point. breaks(2) = !k+2 'Identified second break point series DU1 = @trend> !i series DT1 = DU1*(@trend-!i) series DU2 = @trend>!k series DT2 = DU2*(@trend-!k) equation LPA.ls DSY c SY(-1) DU1 DT1 DU2 DT2 DSY(-1 TO -2) 'Selected equation endif adf(!i)=LPA.@stats(1) next show adf.hist matrix(2,3)cvalue cvalue.fill(b=r)0.01,0.05,0.10 !k=1 for %1 0.01 0.05 .0.10 cvalue(2,!k)=@quantile(adf,%1) !k=!k+1 next show cvalue
Last edited by xuehe on Tue Jan 12, 2010 11:59 pm, edited 2 times in total.

xuehe
Posts: 3
Joined: Tue Jan 12, 2010 10:13 pm

Re: Lumsdaine-Papell Unit Root Test

Postby xuehe » Tue Jan 12, 2010 11:28 pm

Please help set a monte carlo simulation to compute cretical value of lp test.
I have modified your code and added a simulation exercise into the beginning. Although the following code seems to be working and identifying the structural breaks correctly, you can make all the necessary modifications and revisions for more efficient and accurate use.

Code: Select all

'Simulate a series that has two level shifts wfcreate u 100 !b1=17 'First break !b2=45 'Second break smpl @first !b1-1 series sy=@trend + 10*nrnd smpl !b1 !b2-1 sy = 5*@trend + 20*nrnd smpl !b2 @last sy = 7*@trend + 30*nrnd 'Apply Lumsdaine-Papell unit-root test smpl @all !trim = 0.1 'Trimming parameter !t_min = 1000 vector(2) breaks for !i = @round(@obs(sy)*!trim) to @round(@obs(sy)*(1-!trim)) for !k = !i+2 to @round(@obs(sy)*(1-!trim))-2 series DSY = D(SY) equation temp.ls DSY c SY(-1) (@trend>!i) (@trend>!i)*(@trend-!i) (@trend>!k) (@trend>!k)*(@trend-!k) DSY(-1 TO -2) if temp.@tstats(2) < !t_min then !t_min = temp.@tstats(2) breaks(1) = !i+2 'Identified first break point. breaks(2) = !k+2 'Identified second break point series DU1 = @trend> !i series DT1 = DU1*(@trend-!i) series DU2 = @trend>!k series DT2 = DU2*(@trend-!k) equation LPA.ls DSY c SY(-1) DU1 DT1 DU2 DT2 DSY(-1 TO -2) 'Selected equation endif next next delete temp

jfgeli
Posts: 72
Joined: Fri Jan 30, 2009 6:29 pm

Re: Lumsdaine-Papell Unit Root Test

Postby jfgeli » Thu Sep 23, 2010 3:33 am

Hi, I've been following the thread on the Lumsdaine-Papell URT. I must admit that you guys are far beyond of what I could ever dream to do in Eviews. I tried to use the code posted here (and its several modifications) but I always get the same error when estimating the temporary regression:

equation temp.ls DY y(-1) C @trend (@trend>!i-2) (@trend>!i-2)*(@trend-!i+2) DY(-1 to -!best_lag)

I get near singular matrix...

Y in my case is the public debt as a share of GDP of a country. The numbers are not weird, so I actually do not know what could be not working.

I appreciate any advice on this.

Regards,

Federico.

jjaa
Posts: 10
Joined: Tue Sep 28, 2010 8:19 pm

Re: Lumsdaine-Papell Unit Root Test

Postby jjaa » Wed Oct 06, 2010 6:22 pm

Hi,
if i want to run the lumsdaine-papell unit root test without the simulation, which code may i use?

Thank you


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests