Page 1 of 1

A running regressions which refuses OLS

Posted: Sat May 19, 2012 12:51 pm
by RickS
I'd like to excute a rolling regressions on time series data that i generated myself with 'ici' as time series variable (see the program code below). The coefficients that i've used to generate the data are obtained from an earlier estimation. I'd like to store the estimated regression coefficients for the sample 3 january 2007 - 4 january 2007, 3 january 2007 - 5 january 2007, ...., 3 january 2007 - 7 july 2007 in a matrix. When i run the program, there are no errors but Eviews doesn't give me any estimations of coefficients i.e. i get a matrix with the value 0 in all its cells. I tried several things but i can't find the flaw. So my question: what is the problem and are there maybe better/easier programs to execute what i have in mind?

Thanks for those who have solution!

Rick

smpl 01/03/2007 08/07/2007
genr e = nrnd
smpl 01/03/2007 01/03/2007
genr ici = 0
smpl 01/03/2007 07/08/2007
ici = 0.389089 + 0.751592*ici(-1) + e

matrix(151,2) coefficients

for !i = 1 to !i = 150
!i = !i + 1
smpl 01/03/2007 01/04/2007+i-1
equation rollingestimators.ls ici c ici(-1)
rowplace(coefficients,rollingschatters.@coeffs,!i)

next
show coefficients

Re: A running regressions which refuses OLS

Posted: Sat May 19, 2012 1:59 pm
by startz
equation rollingestimators.ls ici c ici(-1)
rowplace(coefficients,rollingschatters.@coeffs,!i)
Looks like you change the name of the equation.

Re: A running regressions which refuses OLS

Posted: Sat May 19, 2012 2:40 pm
by RickS
equation rollingestimators.ls ici c ici(-1)
rowplace(coefficients,rollingschatters.@coeffs,!i)
Looks like you change the name of the equation.
i see: i made a mistake in the translation to English so the variables in are inconsistent in the code i presented. But in the code i runned these variables are consisten. So that is not to problem. Someone else already found the problem?

Thanks anyway!

Re: A running regressions which refuses OLS

Posted: Sat May 19, 2012 4:45 pm
by RickS
So: to adjust the code i presented in my first post, here is the 'right' code (that still doesn't work).

I'd like to excute a rolling regressions on time series data that i generated myself with 'ici' as time series variable (see the program code below). The coefficients that i've used to generate the data are obtained from an earlier estimation. I'd like to store the estimated regression coefficients for the sample 3 january 2007 - 4 january 2007, 3 january 2007 - 5 january 2007, ...., 3 january 2007 - 7 july 2007 in a matrix. When i run the program, there are no errors but Eviews doesn't give me any estimations of coefficients i.e. i get a matrix with the value 0 in all its cells. I tried several things but i can't find the flaw. So my question: what is the problem and are there maybe better/easier programs to execute what i have in mind?

Thanks for those who have solution!

Rick

smpl 01/03/2007 08/07/2007
genr e = nrnd
smpl 01/03/2007 01/03/2007
genr ici = 0
smpl 01/03/2007 07/08/2007
ici = 0.389089 + 0.751592*ici(-1) + e

matrix(151,2) coefficients

for !i = 1 to !i = 150
!i = !i + 1
smpl 01/03/2007 01/04/2007+i-1
equation rollingestimators.ls ici c ici(-1)
rowplace(coefficients,rollingestimators.@coeffs,!i)

next
show coefficients

Re: A running regressions which refuses OLS

Posted: Sat May 19, 2012 4:59 pm
by startz
The equation member @coefs only has one "f." I'm not sure it produces a row vector.

Re: A running regressions which refuses OLS

Posted: Sun May 20, 2012 2:14 am
by RickS
The equation member @coefs only has one "f." I'm not sure it produces a row vector.
I changed it in to @coefs. I still get a matrix with 151 rows and 2 columns with all zeros. The code simulates the data but it still doesn't give me any regression results.