Page 2 of 2

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 9:21 am
by Ioannis84
I used the above code in order to implement the ADF test on a rolling window of 250 obs. However, regarding the results, in each estimation the sample widens by one observation and is not moved.

In particular, the ADF test is employed for the samples:

1-250, 1-251, 1-252 ....

instead of:

1-250, 2-251, 3-252...

Is there any solution???

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 9:34 am
by EViews Gareth
Hard to say what you've done wrong without seeing what you've done.

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 9:54 am
by Ioannis84
I used the following code:

!width = 250

!lastfirst = @obsrange-!width+1
matrix(!lastfirst, 2) uroot

for !i=1 to !lastfirst

smpl @first+!i-1 @first+!i-1+!width-1
freeze(bb) bond_spread.uroot(const, trend)
uroot(!i, 1) = @val(bb(7, 4))
uroot(!i, 2) = @val(bb(7, 5))

if (@isobject("bb")) then
delete bb
endif

next


The examined series is bond_spread the overall sample range is 1/1/2008 2/27/2015.

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 9:58 am
by EViews Gareth
And what makes you believe that it is not using a moving window?

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 10:56 am
by Ioannis84
Intending to verify that the code uses a moving window, i created another one workfile and I runned separately the ADF test for the first 3 subsamples (1-250, 2-251, 3-252). Comparing the results, i realized that the code runs the test in the way that i described in my previous message.

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 11:01 am
by EViews Gareth
An easier way to verify it would be with the following:

Code: Select all

!width = 250 !lastfirst = @obsrange-!width+1 matrix(!lastfirst, 2) uroot table mysamples for !i=1 to !lastfirst smpl @first+!i-1 @first+!i-1+!width-1 freeze(bb!i) bond_spread.uroot(const, trend) uroot(!i, 1) = @val(bb!i(7, 4)) uroot(!i, 2) = @val(bb!i(7, 5)) mysamples(!i,1) = @pagesmpl next show mysamples
The table shows the sample used in each iteration of the loop. I also stopped the deletion of the individual unit root test results, so you can open them up and look at them, and see the sample used.

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Posted: Wed Aug 12, 2015 12:21 pm
by Ioannis84
Thank you very much for your help and the prompt reply.