Page 1 of 1

Recursive least square estimation

Posted: Thu Aug 16, 2012 11:06 am
by auvernois
Hi,

I'm doing a simple OLS regression, and I'd like to estimate and store coefficients recursively, using either an anchored or a rolling estimation period.
I know I could do this into a loop, but it seems that I could do it faster using the "rls" function.
So far, I'm doing this:
equation eq1.ls log(ser1/ser1(-60)) = c(1) + c(2) * log(ser2/ser2(-60))
eq1.rls(c)
2 questions:
- It seems that this "rls" function is using an anchored estimation period, am I right ? Can we use it with a rolling window ?
- The coefficients are plotted on a graph ,but I can't find the underlying series, how do I retrieve them (I actually do not need the chart, just the series).

Thanks :D

Re: Recursive least square estimation

Posted: Thu Aug 16, 2012 11:10 am
by EViews Gareth
RLS won't do what you want. However there are numerous examples of doing rolling regression here on the forum, plus there is an EViews add-in that does it.

Re: Recursive least square estimation

Posted: Thu Aug 16, 2012 11:30 am
by auvernois
Thanks for your quick answer :D !
Actually, I think my explanation wasn't that clear, because I think "rls" would do what I want.
I'd like to simulate doing this regression everyday for the past 50 years, and construct series of coefficients that do not contain forward looking data (coef at time t is computed by doing the regression on a sample that includes only information known up to time t, and so on).
I tried again and replaced rls(c) by rls(c,s) and it seems to be working: I have my series R_C1 and R_C2 with the 2 coefficients over time.
Am I wrong or using this rls function is the equivalent of doing ls regressions in a loop, expanding the estimation sample by a day at each iteration, and storing the coefficients in time series ?
Thanks

Re: Recursive least square estimation

Posted: Thu Aug 16, 2012 11:49 am
by EViews Gareth
RLS won't do rolling, only anchored.

So your description of what it is doing is correct, but if you want rolling, not anchored, you'll have to use rolling regression.

Re: Recursive least square estimation

Posted: Thu Aug 16, 2012 12:04 pm
by auvernois
OK. I'll just stick with anchored for now.
Many thanks.