Page 1 of 1

Rolling BDS test

Posted: Wed Nov 13, 2013 9:35 am
by aurquhart
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

Re: Rolling BDS test

Posted: Wed Nov 13, 2013 9:40 am
by EViews Gareth
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

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 3:01 am
by aurquhart
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

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 3:07 am
by terrya
Hi

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

I use EV8

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 3:18 am
by aurquhart
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

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 3:22 am
by terrya
Why did you rename the series? It's already called y or did you type 'y' instead of y?

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 3:28 am
by aurquhart
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".

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 3:48 am
by aurquhart
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

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 7:53 am
by EViews Gareth
You can use the colplace function to put the column of results into a matrix.

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 8:11 am
by aurquhart
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.

Re: Rolling BDS test

Posted: Thu Jun 05, 2014 8:17 am
by EViews Gareth
How did you use colplace?

Have you looked up the .bdstest procedure in the object reference?

Re: Rolling BDS test

Posted: Fri Jun 06, 2014 3:58 am
by aurquhart
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?