How to perform rolling regressions in RATS

Questions and discussions on Time Series Analysis
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

How to perform rolling regressions in RATS

Unread post by alvarezcc »

Hi!! I´d like to know if somebody knows how to perform rolling regressions with RATS. I´m trying to estimate a persistence coefficient for Costa Rica´s CPI inflation rate. I downloaded this file: rollreg.src from http://fmwww.bc.edu/repec/bocode/r/rollreg.src but when I tried to run it it just did´nt worked. I don´t know if it is becouse of the version I´m working in RATS which is 6.3. I´d really appreciate any kind of help.

Cristian Alvarez.
Universidad de Costa Rica
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: How to perform rolling regressions in RATS

Unread post by moderator »

Try looking up "rolling regressions" in the RATS User's Guide index. You'll find references to a couple of simple examples.

There are a lot of ways to set these up depending on how you want to specify the range (e.g., if you want to loop based on the starting entry or the ending entry, if you want a moving window type regression or want a fixed starting entry, and so on), but the basic tools are pretty straightforward.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to perform rolling regressions in RATS

Unread post by TomDoan »

You might have better luck with this. The main problem with the version posted on the web was that it appeared to be a UNIX text file, which Windows generally doesn't like.

A modernized version of the procedure is now available at:

http://www.estima.com/forum/viewtopic.php?f=7&t=741
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: How to perform rolling regressions in RATS

Unread post by alvarezcc »

Thanks!! But don´t you have the procedure file, I mean the .src file. If you also have an example it would be great. Thanks again!!
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: How to perform rolling regressions in RATS

Unread post by moderator »

No, we don't have a copy of the ROLLREG.SRC file available on our website. The authors never submitted a copy to us, and we do not provides files from others as downloads without their permission.

However, Tom Doan has already posted the code here in this thread, so all you should need to do is copy and paste that into RATS and save it as a file.
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: How to perform rolling regressions in RATS

Unread post by alvarezcc »

Hi!! I have a problem trying to run the rolling regression because I don´t know how to specify the model in RATS. I´m trying to estimate this equation using the procedure that was posted previously:

π= α+β π(t-1)+δM+θε(t-1)+εt

Where:

π = Corresponds to the monthly year to year inflation rate.

M = Rate of growth of money supply.

and

ε= Regression error term.

The matter is that I don´t know how to specify this model, which is supposed to have an ARMA(1,1) structure. I´ll appreciate if someone can tell me how to do this!!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to perform rolling regressions in RATS

Unread post by TomDoan »

You can't do that with the ROLLREG procedure, since that's only for linear regressions, and, because of the lagged residual, this is non-linear.

π= α+β π(t-1)+δM+θε(t-1)+εt

isn't quite in the form that BOXJENK wants. (BOXJENK wants a mean model and an ARMA noise model, not a reduced form like this). The older instruction ITERATE is probably better for this type of equation:

Code: Select all

EQUATION(AR=1,MA=1,REGRESSORS) PIEQ PI
# M
INITIAL PIEQ
*
ITERATE PIEQ start end
where start and end would need to change based upon the type of "roll" that you want.
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: How to perform rolling regressions in RATS

Unread post by alvarezcc »

Thanks Tom!! But I have one more doubt.How can I tell RATS using the iterate function to do rolling estimates like the ADD and MOVE options in the rollreg procedure that was posted. Or is it that I have to do all the regressions one by one? Thanks for your help!!

Cristian Alvarez C.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to perform rolling regressions in RATS

Unread post by TomDoan »

That's actually all that the rollreg procedure is doing - in that case a set of linreg's. The point of the procedure is that it handles figuring out what set of regressions need to be run for a given set of options and then gives you options for the output.
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: How to perform rolling regressions in RATS

Unread post by alvarezcc »

Hi!! Finally, I have the persistence estimates but I obtained some AR(1) negative coefficients for a subset of the sample. Does anybody Knows how to interpret the AR(1) negative coefficients in this context?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to perform rolling regressions in RATS

Unread post by TomDoan »

Possibly there's rather substantial collinearity between M(t) and pi(t-1) over that period. Is the coefficient negative but not significantly so?
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: How to perform rolling regressions in RATS

Unread post by alvarezcc »

Thanks for your answer Tom! I have rolling window estimates for 1990:01 to 2008:12 (with 72 data points). The model is an AR(1) for monthly inflation rate with the money supply growth rate as a control variable (lagged two periods). I have two subsets of the sample where the coefficient associatted to the lagged inflation is negative. This are 1990:01 to 1992:08 and 2007:4 to 2008:12. As you can see, the negative coefficients are distributed in the beggining and the end of the entire sample. For the first subset 15.5% coefficients are significant at 10% and for the second subsample none are significant at the same level. However, this problem persists even if I remove the money supply growth rate from the right hand side of the equation. I hope this information might be usefull. Thanks again!!
shruti
Posts: 2
Joined: Wed Jul 15, 2009 3:16 am

Re: How to perform rolling regressions in RATS

Unread post by shruti »

hi,
Is there any way to run rolling bivariate regression with the lags of variables and estimate rolling impulse response functions??
I am trying to estimate effect of oil prices on India's GDP using a moving window of 40 quarters, but am not very successful.

Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to perform rolling regressions in RATS

Unread post by TomDoan »

shruti wrote:hi,
Is there any way to run rolling bivariate regression with the lags of variables and estimate rolling impulse response functions??
I am trying to estimate effect of oil prices on India's GDP using a moving window of 40 quarters, but am not very successful.

Thanks
Rolling regressions themselves are fairly easy; it's figuring out what you want as a result and organizing the saving of that. I'm not sure that rolling IRF's are going to be all that useful. They're an indirect function of the coefficients and aren't very likely to change from period to period in a fashion that is likely to be enlightening. Is there any reason not to just compare the IRF's at several samples?
shruti
Posts: 2
Joined: Wed Jul 15, 2009 3:16 am

Re: How to perform rolling regressions in RATS

Unread post by shruti »

Thanks for the reply,
But actually what I am trying to do is to reproduce the results of Blanchard's paper The Macroeconomic Effects of oil prices: Why are 2000s different from 1970s. In section 4 of this paper, authors did the same exercise. Please have a look:
http://www.nber.org/papers/w13368.pdf?new_window=1
Post Reply