A running regressions which refuses OLS

For questions regarding programming in the EViews programming language.

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

RickS
Posts: 5
Joined: Sat May 19, 2012 12:31 pm

A running regressions which refuses OLS

Postby RickS » Sat May 19, 2012 12:51 pm

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

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: A running regressions which refuses OLS

Postby startz » Sat May 19, 2012 1:59 pm

equation rollingestimators.ls ici c ici(-1)
rowplace(coefficients,rollingschatters.@coeffs,!i)
Looks like you change the name of the equation.

RickS
Posts: 5
Joined: Sat May 19, 2012 12:31 pm

Re: A running regressions which refuses OLS

Postby RickS » Sat May 19, 2012 2:40 pm

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!

RickS
Posts: 5
Joined: Sat May 19, 2012 12:31 pm

Re: A running regressions which refuses OLS

Postby RickS » Sat May 19, 2012 4:45 pm

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

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: A running regressions which refuses OLS

Postby startz » Sat May 19, 2012 4:59 pm

The equation member @coefs only has one "f." I'm not sure it produces a row vector.

RickS
Posts: 5
Joined: Sat May 19, 2012 12:31 pm

Re: A running regressions which refuses OLS

Postby RickS » Sun May 20, 2012 2:14 am

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.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests