Long run time in ls regression with lagged variables
Moderators: EViews Gareth, EViews Moderator
Long run time in ls regression with lagged variables
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
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
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
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
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
Change those last lines to be this:
and then look at the two scalar objects. On my PC they are both 0.0001 seconds.
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
Re: Long run time in ls regression with lagged variables
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
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
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
Version 7.2; Enterprise Edition - Jun 2 2011 build
Thanks!
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
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.
Re: Long run time in ls regression with lagged variables
I'll install the patches and then try again. If I still have problem after that, can I just reply to this topic?
Thanks.
Thanks.
Re: Long run time in ls regression with lagged variables
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.
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
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
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
Could you reverse the order of the operations?
Re: Long run time in ls regression with lagged variables
You mean reverse the order of the two command lines?
Re: Long run time in ls regression with lagged variables
I tried reversing the two lines and reversing the order of lags in the short-form. Both scenarios have similar delays as before. Thanks.
Who is online
Users browsing this forum: No registered users and 0 guests
