Long run time in ls regression with lagged variables

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

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 8:46 am

Hello,
I'm experiencing unusually long run time in ls regressions with lagged independent variables when I use the short-form (see below) instead of listing out each of the lagged variables. Is there anything I can do to reduce the execution time of the short-form, especially when I want to repeat the same process for a large number of variables?

equation test.ls y c x(0 to -3) '<<<This short-form takes a lot longer to run but coding is much easier and cleaner
vs.
equation test.ls y c x x(-1) x(-2) x(-3) '<<<EViews takes much less time to run this

Thanks,
viv

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

Re: Long run time in ls regression with lagged variables

Postby EViews Gareth » Wed Apr 15, 2015 9:03 am

This should not be the case, and I can think of no reason why it would happen. Do you have an example workfile/program that shows this?

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 9:14 am

Hi,

I copied out the codes from my original program to test it out. I literally watch the screen as the program runs and it definitely takes a lot longer when it runs the last line (the short-form) versus the second last which does the exact same thing. My data is pulled from Haver.

Here're the codes.

wfcreate(wf=US_MODEL, page=monthly) M 1981m12 2015m12
smpl @all

'**********GET DATA
fetch(d=USECON) TMMCAH TMXAH IP

'***international trade
rename TMMCAH im_vol
rename TMXAH ex_vol

rename IP ind_prod

pageselect monthly

string var_all_m = ""

string var_non_station_m = "im_vol ex_vol ind_prod"
for %y {var_non_station_m}
series {%y}_ln=dlog({%y})
var_all_m = var_all_m + %y + "_ln "
next

equation test1.ls ind_prod_ln c ex_vol_ln ex_vol_ln(-1) ex_vol_ln(-2) ex_vol_ln(-3)
equation test2.ls ind_prod_ln c ex_vol_ln(0 to -3)

Thanks,
viv

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

Re: Long run time in ls regression with lagged variables

Postby EViews Gareth » Wed Apr 15, 2015 9:30 am

Change those last lines to be this:

Code: Select all

tic equation test1.ls ind_prod_ln c ex_vol_ln ex_vol_ln(-1) ex_vol_ln(-2) ex_vol_ln(-3) scalar time1=@toc tic equation test2.ls ind_prod_ln c ex_vol_ln(0 to -3) scalar time2 = @toc
and then look at the two scalar objects. On my PC they are both 0.0001 seconds.

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 9:39 am

Hi,
So I did as you said.
time1 (all variables listed) = 0.006000
time2 (short-form) = 23.61100
So what went wrong then?
Thanks again,
viv

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

Re: Long run time in ls regression with lagged variables

Postby EViews Gareth » Wed Apr 15, 2015 10:57 am

What is the version and build date of your copy of EViews? (Help->about EViews)

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 11:00 am

Version 7.2; Enterprise Edition - Jun 2 2011 build
Thanks!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Long run time in ls regression with lagged variables

Postby EViews Glenn » Wed Apr 15, 2015 11:08 am

At the very least, you should certainly download the latest patch to 7.2 which is more than two years newer than your version. Let us know if it doesn't solve the problem.
Last edited by EViews Glenn on Wed Apr 15, 2015 11:17 am, edited 1 time in total.

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 11:12 am

I'll install the patches and then try again. If I still have problem after that, can I just reply to this topic?
Thanks.

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 11:38 am

I installed the latest patch which brings me up to "Oct 17 2013 build" and ran the program again. But not much improvement.
time1 = 0.010000
time2 = 22.42800
Thanks.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Long run time in ls regression with lagged variables

Postby EViews Glenn » Wed Apr 15, 2015 12:40 pm

Yes. And we'll look into it, though I should warn you that EViews 7 is almost certainly not going to receive any more updates.

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 12:44 pm

Thanks for your help!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Long run time in ls regression with lagged variables

Postby EViews Glenn » Wed Apr 15, 2015 12:46 pm

Could you reverse the order of the operations?

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 12:48 pm

You mean reverse the order of the two command lines?

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Long run time in ls regression with lagged variables

Postby vivienle » Wed Apr 15, 2015 1:12 pm

I tried reversing the two lines and reversing the order of lags in the short-form. Both scenarios have similar delays as before. Thanks.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 0 guests