Page 1 of 2
Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 8:46 am
by vivienle
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
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 9:03 am
by EViews Gareth
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?
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 9:14 am
by vivienle
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
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 9:30 am
by EViews Gareth
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.
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 9:39 am
by vivienle
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
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 10:57 am
by EViews Gareth
What is the version and build date of your copy of EViews? (Help->about EViews)
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 11:00 am
by vivienle
Version 7.2; Enterprise Edition - Jun 2 2011 build
Thanks!
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 11:08 am
by EViews Glenn
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.
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 11:12 am
by vivienle
I'll install the patches and then try again. If I still have problem after that, can I just reply to this topic?
Thanks.
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 11:38 am
by vivienle
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.
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 12:40 pm
by EViews Glenn
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.
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 12:44 pm
by vivienle
Thanks for your help!
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 12:46 pm
by EViews Glenn
Could you reverse the order of the operations?
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 12:48 pm
by vivienle
You mean reverse the order of the two command lines?
Re: Long run time in ls regression with lagged variables
Posted: Wed Apr 15, 2015 1:12 pm
by vivienle
I tried reversing the two lines and reversing the order of lags in the short-form. Both scenarios have similar delays as before. Thanks.