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???
Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Last edited by Ioannis84 on Wed Aug 12, 2015 9:50 am, edited 1 time in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Hard to say what you've done wrong without seeing what you've done.
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
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.
!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.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
And what makes you believe that it is not using a moving window?
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
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.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
An easier way to verify it would be with the following:
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.
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
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Thank you very much for your help and the prompt reply.
Who is online
Users browsing this forum: No registered users and 2 guests
