Slow Least Squares Estimation Due to Lags

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

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Slow Least Squares Estimation Due to Lags

Postby vkarora » Fri Aug 16, 2013 4:35 am

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.

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

Re: Slow Least Squares Estimation Due to Lags

Postby EViews Gareth » Fri Aug 16, 2013 6:14 am

It seems unlikely there would be any difference. Are you sure?

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Re: Slow Least Squares Estimation Due to Lags

Postby vkarora » Fri Aug 16, 2013 7:33 am

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.
Attachments
dfm_pca.prg
(8.27 KiB) Downloaded 375 times

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

Re: Slow Least Squares Estimation Due to Lags

Postby EViews Gareth » Fri Aug 16, 2013 8:12 am

Could we have the workfile too?

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Re: Slow Least Squares Estimation Due to Lags

Postby vkarora » Fri Aug 16, 2013 8:20 am

Sorry, it is attached.
Attachments
ngpd_pca2.wf1
(48.51 KiB) Downloaded 307 times

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

Re: Slow Least Squares Estimation Due to Lags

Postby EViews Gareth » Fri Aug 16, 2013 8:27 am

How do I replicate what you're seeing?

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

vkarora
Posts: 9
Joined: Fri May 31, 2013 10:59 am

Re: Slow Least Squares Estimation Due to Lags

Postby vkarora » Fri Aug 16, 2013 8:51 am

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.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests