Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

For questions regarding programming in the EViews programming language.

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

Ioannis84
Posts: 4
Joined: Wed Aug 12, 2015 9:03 am

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Postby Ioannis84 » Wed Aug 12, 2015 9:21 am

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???
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

Postby EViews Gareth » Wed Aug 12, 2015 9:34 am

Hard to say what you've done wrong without seeing what you've done.

Ioannis84
Posts: 4
Joined: Wed Aug 12, 2015 9:03 am

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Postby Ioannis84 » Wed Aug 12, 2015 9:54 am

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.

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

Postby EViews Gareth » Wed Aug 12, 2015 9:58 am

And what makes you believe that it is not using a moving window?

Ioannis84
Posts: 4
Joined: Wed Aug 12, 2015 9:03 am

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Postby Ioannis84 » Wed Aug 12, 2015 10:56 am

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

Postby EViews Gareth » Wed Aug 12, 2015 11:01 am

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.

Ioannis84
Posts: 4
Joined: Wed Aug 12, 2015 9:03 am

Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation

Postby Ioannis84 » Wed Aug 12, 2015 12:21 pm

Thank you very much for your help and the prompt reply.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests