Maximum Number of Regressors in OLS

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

PERRYGOGAS
Posts: 36
Joined: Sat Nov 01, 2008 12:22 pm

Maximum Number of Regressors in OLS

Postby PERRYGOGAS » Mon Nov 29, 2010 1:15 am

What is the maximum number of regressors I can use in EVIEWS? I need to estimate a model with 750 autoregressive lags.

Thank you very much!

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Maximum Number of Regressors in OLS

Postby trubador » Mon Nov 29, 2010 1:25 am

The default size of the coefficent vector (C) is 750. However, you can always define your own coefficent vector prior to the estimation and use it instead.

PERRYGOGAS
Posts: 36
Joined: Sat Nov 01, 2008 12:22 pm

Re: Maximum Number of Regressors in OLS

Postby PERRYGOGAS » Mon Nov 29, 2010 8:41 am

Hello and thank you! how do I specify the size?

I mean that ok I created a coefficient vector with 1000 rows named cc. But trying to estimate an OLS from Quick-Estimate Equation with 1000 regressors I still get an error message. How can I do it?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Maximum Number of Regressors in OLS

Postby EViews Gareth » Mon Nov 29, 2010 9:06 am

Unfortunately you can no longer estimate an equation by list if you want to use your own coefficient vector. You have to estimate by expression.
Follow us on Twitter @IHSEViews

PERRYGOGAS
Posts: 36
Joined: Sat Nov 01, 2008 12:22 pm

Re: Maximum Number of Regressors in OLS

Postby PERRYGOGAS » Mon Nov 29, 2010 9:17 am

EViews Gareth wrote:Unfortunately you can no longer estimate an equation by list if you want to use your own coefficient vector. You have to estimate by expression.


Dear Gareth, thank you for your reply.

I have created a vector named "CC" as the alternative coef vector with 1000 rows.

Typing:

ls price c coal(-1 to 800)

I get an error message...how can I instruct eviews to use the CC coef vector and avoid this error message?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Maximum Number of Regressors in OLS

Postby EViews Gareth » Mon Nov 29, 2010 9:25 am

As I said above, you can't specify by list (which is what you're doing there). You'll need to specify by expression:

Code: Select all

price = cc(1) + cc(2)*coal(-1) + cc(3)*coal(-2) +


and so on. Yes this is a mighty pain if you have to write out 1000 of them.

However it isn't hard to write a program that will do it for you. See below:

Code: Select all

create u 100000

series price = nrnd
series coal = nrnd
coef(1001) cc

%regs = ""
for !i=1 to 1000
   %regs = %regs + " + cc(" + @str(!i) + ")*coal(-" + @str(!i) + ")"
next

equation e1.ls price=cc(1001) {%regs}
Follow us on Twitter @IHSEViews

PERRYGOGAS
Posts: 36
Joined: Sat Nov 01, 2008 12:22 pm

Re: Maximum Number of Regressors in OLS

Postby PERRYGOGAS » Mon Nov 29, 2010 10:03 am

That is great! thank you very much!

JamesEviews
Posts: 4
Joined: Mon Nov 01, 2010 2:53 am

Re: Maximum Number of Regressors in OLS

Postby JamesEviews » Mon Nov 29, 2010 11:53 pm

Greetings. Gareth, plse unpack what the mini prog is doing. I am fascinated. In particular, the loop.
Regards, James Johnson

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Maximum Number of Regressors in OLS

Postby EViews Gareth » Tue Nov 30, 2010 12:07 am

The loop is just building up a string.

First iteration

Code: Select all

%regs = "+ cc(1)*coal(-1)"


Second iteration

Code: Select all

%regs = %regs + "+ cc(2)*coal(-2)"

which is

Code: Select all

%regs = "+ cc(1)*coal(-1) + cc(2)*coal(-2)"


and so on.

At the end %regs will be equal to

Code: Select all

"+ cc(1)*coal(-1) + cc(2)*coal(-2) + cc(3)*coal(-2) + ........  + cc(1000)*coal(-1000)"


I then just use that in the regression:

Code: Select all

ls price=cc(1001) + cc(1)*coal(-1) + cc(2)*coal(-2) + cc(3)*coal(-3) + ...... + cc(1000)*coal(-1000)
Follow us on Twitter @IHSEViews

JamesEviews
Posts: 4
Joined: Mon Nov 01, 2010 2:53 am

Re: Maximum Number of Regressors in OLS

Postby JamesEviews » Tue Nov 30, 2010 12:42 am

Much thanks, Gareth. You are a good teacher. Many thanks to Perry for asking the question also.
James


Return to “Estimation”

Who is online

Users browsing this forum: Google [Bot] and 27 guests