Page 1 of 1

Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 4:35 am
by vkarora
My apologies if this topic has been covered before, but I cannot seem to find it anywhere on or off the forum. I am running EViews 8, but have also tried this on EViews 7.

In various contexts I want to estimate many equations and their lags, so for example I want to try the same equation with one lag, two lags, etc using basic least squares. For example:

eq.ls gdp gdp(-1) oilp(-1)

and

eq.ls gdp gdp(-1) gdp(-2) oilp(-1) oilp(-2)

what I am finding is that the specification with two lags above runs much faster than the following (which I am currently using in various loops):

eq.ls gdp gdp(-1 to -2) oilp(-1 to -2)

I can post my code if you like, but was hoping there was a previous thread I have not seen that addresses this issue. Any other help on why the final specification might be so slow would be appreciated. Thanks.

Re: Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 6:14 am
by EViews Gareth
It seems unlikely there would be any difference. Are you sure?

Re: Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 7:33 am
by vkarora
That is what I thought. I've attached the program, I've tried it on two different machines and it is very slow in both cases. About halfway down you'll see some loops where I estimate several equations with the lags changing dynamically. When I type in the lags manually (for up to 6 lags) all of the loops take less than a couple of minutes. When I run the program as attached it takes at least 90 minutes.

I've also run completely different programs with a similar looping structure to go over multiple lags and I have the same problem.

Thanks for your help with this.

Re: Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 8:12 am
by EViews Gareth
Could we have the workfile too?

Re: Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 8:20 am
by vkarora
Sorry, it is attached.

Re: Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 8:27 am
by EViews Gareth
How do I replicate what you're seeing?

I just ran the program on the workfile. It took 4.268 seconds to run.

Re: Slow Least Squares Estimation Due to Lags

Posted: Fri Aug 16, 2013 8:51 am
by vkarora
I'm not sure, but I think I figured out the problem. After your message I stopped allowing the program to automatically search databases (Options: DB registry), and now it works very quickly. Thanks for looking into this so quickly.