Rolling BDS test

For making suggestions and/or requests for new features you'd like added to EViews.

Moderators: EViews Gareth, EViews Moderator

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Rolling BDS test

Postby aurquhart » Wed Nov 13, 2013 9:35 am

Is it possible conduct a rolling BDS on data in EViews? I have tried a few different loops but it doesn't seem to be working.

Any suggestions?

Thanks

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling BDS test

Postby EViews Gareth » Wed Nov 13, 2013 9:40 am

Sure it is.

Code: Select all

create u 1000
series y=@nrnd

!window = 50
!step = 20
for !i=1 to 100 step !step
   smpl @first+!i-1 @first+!i+!window-1
   y.bdstest(o=vec!i)
next
Follow us on Twitter @IHSEViews

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Re: Rolling BDS test

Postby aurquhart » Thu Jun 05, 2014 3:01 am

Hi Gareth,

Thanks for your reply. However the code seems to not work.

When I input the line "for !i=1 to 100 step !step", an error message appears saying 'flow of control statement executed from the command list".

And then after I input the next line I get "error in sample !I is not defined".

Can you help with this or tell me what the issue is?

Many thanks

Andrew

terrya
Posts: 107
Joined: Wed Aug 26, 2009 2:37 pm

Re: Rolling BDS test

Postby terrya » Thu Jun 05, 2014 3:07 am

Hi

I just used Gareth's program (copied from the post and pasted not retyped) and it worked fine.

I use EV8

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Re: Rolling BDS test

Postby aurquhart » Thu Jun 05, 2014 3:18 am

Hi Terry,

I have done the same but I still get an error message. I also use EV8. I have named the series 'y'. Does it matter how many observations there are? I am also using a clean Eviews file.

I am missing something really stupid.

Thanks

Andrew

terrya
Posts: 107
Joined: Wed Aug 26, 2009 2:37 pm

Re: Rolling BDS test

Postby terrya » Thu Jun 05, 2014 3:22 am

Why did you rename the series? It's already called y or did you type 'y' instead of y?

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Re: Rolling BDS test

Postby aurquhart » Thu Jun 05, 2014 3:28 am

What i meant was that I have named my series y, and then copied and pasted the code and I get the error message "flow of control statement executed from the command line".

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Re: Rolling BDS test

Postby aurquhart » Thu Jun 05, 2014 3:48 am

Thanks guys, I have got it to work.

One more question: I have over 10,000 observations and want a window size of 500 that rolls 10 observations at a time, thus the number of outputs will be quite large. Is there anyway to have the outputs put in a matrix one after another?

Thanks again,

Andrew

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling BDS test

Postby EViews Gareth » Thu Jun 05, 2014 7:53 am

You can use the colplace function to put the column of results into a matrix.
Follow us on Twitter @IHSEViews

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Re: Rolling BDS test

Postby aurquhart » Thu Jun 05, 2014 8:11 am

Thanks for your reply Gareth.

So far I have the following code for a 5079 observation sample running the BDS test for a 500 observation window rolling forward 20 observations at a time;

create u 5079
series y=@nrnd

!window = 500
!step = 20
for !i=1 to 5079 step !step
smpl @first+!i-1 @first+!i+!window-1
y.bdstest(o=vec!i)
next

I have tried to input the colplace function but it doesn't seem to work. Can you help with this?

Also, is it possible for the rolling bds test to provide the p-values/z-statistics as well? What do you need to input?

Thanks again and I look forward to your reply.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13294
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling BDS test

Postby EViews Gareth » Thu Jun 05, 2014 8:17 am

How did you use colplace?

Have you looked up the .bdstest procedure in the object reference?
Follow us on Twitter @IHSEViews

aurquhart
Posts: 7
Joined: Wed Oct 09, 2013 2:13 am

Re: Rolling BDS test

Postby aurquhart » Fri Jun 06, 2014 3:58 am

I use the following code and it works great! However when I include in the bracket e=2, I get a zero output each time. Is there anyway of storing the bootrapped p-values, or the ordinary p-values? (I can't see an option for this in the object reference).

create u 5079
series y=@nrnd

!window = 500
!step = 20
for !i=1 to 5079 step !step
smpl @first+!i-1 @first+!i+!window-1
y.bdstest(o=vec!i, b=1000, d=10, m=s)
next

Also I am confused about how to use colplace - can you help?


Return to “Suggestions and Requests”

Who is online

Users browsing this forum: No registered users and 6 guests