Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Good Afternoon,
I am wondering if anyone can provide me with a code to run a rolling window (of 250) on a data set of returns for the following three tests: Variance Ratio, Augmented Dickey Fuller and Autocorrelations.
Thank you very much,
Sean
P.S.
Please let me know if you need the data. Data is currently from EViews 5, but I will be purchasing EViews 7 if someone can help me with this (I realize there is no Variance Ratio test in EViews 5).
I am wondering if anyone can provide me with a code to run a rolling window (of 250) on a data set of returns for the following three tests: Variance Ratio, Augmented Dickey Fuller and Autocorrelations.
Thank you very much,
Sean
P.S.
Please let me know if you need the data. Data is currently from EViews 5, but I will be purchasing EViews 7 if someone can help me with this (I realize there is no Variance Ratio test in EViews 5).
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
This snippet computes widowed ADF unit root and variance ratio tests on the series PROBLEMR on all of the windows of with 20 in a workfile and saves the stat values and p-values into the matrices UROOT and VRATIO. If you change the settings in the variance ratio test and the unit root tests you may have to locate the results in difference cells of the temp matrices AA and BB.
Note that the key here is that I use offsets from the first observation in the sample statement (smpl). The only tricky part is to make certain that we know the number of value intervals in the workfile (by looking at the number of observations and looking backward using the window width) and that we get the endpoint math in the interval definition right...
It should be pretty easy to modify this code as needed. Note that I didn't do the autocorrelation one since I"m not entirely certain which statistic you want.
Note also that there are more sophisticated examples provided with your copy of EViews.
Note that the key here is that I use offsets from the first observation in the sample statement (smpl). The only tricky part is to make certain that we know the number of value intervals in the workfile (by looking at the number of observations and looking backward using the window width) and that we get the endpoint math in the interval definition right...
Code: Select all
!width = 20
!lastfirst = @obsrange-!width+1
matrix(!lastfirst, 2) vratio
matrix(!lastfirst, 2) uroot
for !i=1 to !lastfirst
smpl @first+!i-1 @first+!i-1+!width-1
freeze(aa) problemr.vratio 2 4 8 16
vratio(!i, 1) = @val(aa(9, 3))
vratio(!i, 2) = @val(aa(9, 5))
freeze(bb) problemr.uroot(const)
uroot(!i, 1) = @val(bb(7, 4))
uroot(!i, 2) = @val(bb(7, 5))
if (@isobject("aa")) then
delete aa
endif
if (@isobject("bb")) then
delete bb
endif
next
Note also that there are more sophisticated examples provided with your copy of EViews.
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
EViews Glenn,
Thank you very much for this information.
At this point in time I would say that I understand about 90% of what you provided. I realize the office is closed today, but on July 5th are you able to take a call, or should I just call the general customer help and be transferred to the Technical Support team?
Thanks,
Sean
Thank you very much for this information.
At this point in time I would say that I understand about 90% of what you provided. I realize the office is closed today, but on July 5th are you able to take a call, or should I just call the general customer help and be transferred to the Technical Support team?
Thanks,
Sean
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Emailing support@eviews.com with your question and serial number is generally the best way - questions over the phone, especially programming questions tend to be more tricky to answer clearly.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
I just answered the phone call on this one, which I have no problems with though it's at the boundaries of our tech support.
I will mention that posting any questions that you might have to the forum may be a better way to approach this since at that point anyone can answer (and other people, in particular Gareth monitor the forums more diligently than I) and since others will then benefit from the response. This is especially true when you are looking for a response after hours or on significant holidays representing my country throwing off the yoke of repression (sorry Gareth! :))
I will mention that posting any questions that you might have to the forum may be a better way to approach this since at that point anyone can answer (and other people, in particular Gareth monitor the forums more diligently than I) and since others will then benefit from the response. This is especially true when you are looking for a response after hours or on significant holidays representing my country throwing off the yoke of repression (sorry Gareth! :))
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
You might want to do a quick count around the office of how many are subjects of the Queen before making such posts.
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Thank you again for all of the help EViews Glenn and Gareth.
One quick question. If I change the following line:
freeze(bb) problemr.uroot(const)
to:
freeze(bb) problemr.uroot(adf,trend)
Will that run the unit root test with both a constant and trend? And, specifically as the augmented dickey fuller unit root test?
Thanks,
Sean
One quick question. If I change the following line:
freeze(bb) problemr.uroot(const)
to:
freeze(bb) problemr.uroot(adf,trend)
Will that run the unit root test with both a constant and trend? And, specifically as the augmented dickey fuller unit root test?
Thanks,
Sean
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Yes, though you don't need the "adf" since that's the default.
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Hi Again,
I have attached the outputs of the rolling tests in excel format below (Unit Root and Variance Ratio).
The headers to the outputs are C1 and C2. In each example, what would C1 and C2 stand for?
Also, if one does a non-rolling variance ratio test they will get outputs for each 2, 4, 8, 16 (or 2, 5, 10, 20 as I used), but in the rolling test there is not outputs for each. Is this something to be concerned about?
Thanks
P.S. - In case it is useful I have also attached the original return data that the rolling tests were done on.
I have attached the outputs of the rolling tests in excel format below (Unit Root and Variance Ratio).
The headers to the outputs are C1 and C2. In each example, what would C1 and C2 stand for?
Also, if one does a non-rolling variance ratio test they will get outputs for each 2, 4, 8, 16 (or 2, 5, 10, 20 as I used), but in the rolling test there is not outputs for each. Is this something to be concerned about?
Thanks
P.S. - In case it is useful I have also attached the original return data that the rolling tests were done on.
- Attachments
-
- t - returns.csv
- Original return data that rolling tests were conducted on
- (64.88 KiB) Downloaded 386 times
-
- T (adf,trend) - unit root.xls
- Unit Root Test
- (360.5 KiB) Downloaded 398 times
-
- T - vratio.xls
- Variance Ratio
- (366.5 KiB) Downloaded 414 times
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
I'm not certain that I understand the question. If C1 and C2 came from the EViews matrix, they're just column headers for Column 1 and Column 2.
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
My apologies for not wording my question in an understandable manner.
In regards to C1 and C2, I think you are probably right that this is Column 1 and 2.
What I guess I meant to ask is the following:
What do the data-points below C1 and C2 represent.
For example, for the unit root test, are the data-points in column 1 some sort of coefficient and the data points in column 2 representative of the probability of that coefficient being insignificant?
For the variance ratio test, I am wondering the same. What do the data-points in each column represent.
Thank you,
In regards to C1 and C2, I think you are probably right that this is Column 1 and 2.
What I guess I meant to ask is the following:
What do the data-points below C1 and C2 represent.
For example, for the unit root test, are the data-points in column 1 some sort of coefficient and the data points in column 2 representative of the probability of that coefficient being insignificant?
For the variance ratio test, I am wondering the same. What do the data-points in each column represent.
Thank you,
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
As I mentioned in the original posting on this my quick-and-dirty example program saves both the stat values and p-values.
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
Thanks again for the info (and sorry for missing it above). A couple more questions, hopefully simple to answer.
I just want to confirm what the "stat value" would be for both of the tests.
Variance Ratio Test
- Is this the "Max Z-Statistic" for the joint test of each window?
Unit Root Test
- Is this the "t-statistic" on the first lag?
If I am incorrect on these, could you please correct me.
Thank you,
I just want to confirm what the "stat value" would be for both of the tests.
Variance Ratio Test
- Is this the "Max Z-Statistic" for the joint test of each window?
Unit Root Test
- Is this the "t-statistic" on the first lag?
If I am incorrect on these, could you please correct me.
Thank you,
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
If you compare them to the corresponding values in the test for one of your windows you'll see that this is the case. Note that all that we did here was to identify the cell containing the value (row and column of the output). You should take care to note whether the thing you are rolling possibly puts results in different places (in these cases, I believe that this is true).
-
Sara Elsayed
- Posts: 8
- Joined: Thu Jul 24, 2014 12:03 pm
Re: Rolling: Variance Ratio, Dickey Fuller, Autocorrelation
can I have questions regarding the programming of rolling window?
First:
what do these lines refer to?
vratio(!i, 1) = @val(aa(9, 3))
vratio(!i, 2) = @val(aa(9, 5))
what is 9,3,5 ?! I can not understand
Second:
what if i want to do rolling for MVR using bootstrap option not asymptotic?
Are p-values in results refer to wild p-value or just p-value for conventional chow and Denning for each sample using asymptotic option?
Please, help
First:
what do these lines refer to?
vratio(!i, 1) = @val(aa(9, 3))
vratio(!i, 2) = @val(aa(9, 5))
what is 9,3,5 ?! I can not understand
Second:
what if i want to do rolling for MVR using bootstrap option not asymptotic?
Are p-values in results refer to wild p-value or just p-value for conventional chow and Denning for each sample using asymptotic option?
Please, help
Who is online
Users browsing this forum: No registered users and 2 guests
