Page 1 of 1
Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 1:15 am
by PERRYGOGAS
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!
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 1:25 am
by trubador
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.
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 8:41 am
by PERRYGOGAS
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?
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 9:06 am
by EViews Gareth
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.
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 9:17 am
by PERRYGOGAS
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?
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 9:25 am
by EViews Gareth
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}
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 10:03 am
by PERRYGOGAS
That is great! thank you very much!
Re: Maximum Number of Regressors in OLS
Posted: Mon Nov 29, 2010 11:53 pm
by JamesEviews
Greetings. Gareth, plse unpack what the mini prog is doing. I am fascinated. In particular, the loop.
Regards, James Johnson
Re: Maximum Number of Regressors in OLS
Posted: Tue Nov 30, 2010 12:07 am
by EViews Gareth
The loop is just building up a string.
First iteration
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)
Re: Maximum Number of Regressors in OLS
Posted: Tue Nov 30, 2010 12:42 am
by JamesEviews
Much thanks, Gareth. You are a good teacher. Many thanks to Perry for asking the question also.
James