How to speed ADL model selection up if model is big?
Posted: Wed Nov 12, 2014 5:04 am
Hello EViews Forum Admins!
First things first:
I am using EViews 7, but I have access to Eviews 8.
I have got a technical problem, and here it is:
I am a little "advanced" in EViews programming which means I learn it from User's Manual and this Forum for 2 month or so.
What I do:
I try to find the best lag structure for an ADL Model based on 14 regressors. I wrote a giant FOR-loop with an integrated if-statement included to estimate all possible lag combinations and to automalically select the best model regarding to AIC. The code below works fine, but:
What is my problem:
I have 19 periods where I have to find the best model to do a one-step-ahead-forecast at each point in time. That means I do a Preudo Out Of Sample (POOS) approach and I need to identify the best model for each of the 19 one step ahead forecasts. Meaning: the optimal model for the one-step-ahead-fc for 2013M01 is maybe a different model than the optimal model used to find the one-step-ahead-forecast 2013M2 and so on. The problem is, that I have to do this loop 19 times but one iteration lasts about 8h (
) This is way to much. Since I work on my Master's Thesis, I need to experiment a little and to run a lot of regressions. It is therefore technically sheer impossible to do this calculation and to use this approach. Because I would consider it to be extremely irritating if I couldn't use all the information I have (all regressors) because it simply costs too much time. So there must be another way to program this in EViews which allows quicker estimation.
Otherwise this would be really a drawback...
I would appreciate help very much! Thanks for your time.
Regards from Heidelberg, Germany,
K
First things first:
I am using EViews 7, but I have access to Eviews 8.
I have got a technical problem, and here it is:
I am a little "advanced" in EViews programming which means I learn it from User's Manual and this Forum for 2 month or so.
What I do:
I try to find the best lag structure for an ADL Model based on 14 regressors. I wrote a giant FOR-loop with an integrated if-statement included to estimate all possible lag combinations and to automalically select the best model regarding to AIC. The code below works fine, but:
What is my problem:
I have 19 periods where I have to find the best model to do a one-step-ahead-forecast at each point in time. That means I do a Preudo Out Of Sample (POOS) approach and I need to identify the best model for each of the 19 one step ahead forecasts. Meaning: the optimal model for the one-step-ahead-fc for 2013M01 is maybe a different model than the optimal model used to find the one-step-ahead-forecast 2013M2 and so on. The problem is, that I have to do this loop 19 times but one iteration lasts about 8h (
I would appreciate help very much! Thanks for your time.
Code: Select all
'Find the best Modell / Optimal Lag Structure:
scalar bestaic = 1e10
for !a=0 to 3 step 1
for !b=0 to 3 step 1
for !c=0 to 3 step 1
for !d=0 to 3 step 1
for !e=0 to 3 step 1
for !f=0 to 3 step 1
for !g=0 to 3 step 1
for !h=0 to 3 step 1
for !i=0 to 3 step 1
for !j=0 to 3 step 1
for !k=0 to 3 step 1
for !l=0 to 3 step 1
for !m=0 to 3 step 1
for !n=0 to 3 step 1
smpl @first 2012m12
equation arma_!a!b!c!d!e!f!g!h!i!j!k!l!m!n.ls del_quant_sa offtief_fc( -!a) gewtief_fc(-!b) wasser_fc(-!c) gas_fc(-!d) ifo_fc(-!e) gas_p_fc(-!f) bau_pi_fc(-!g) del_quant_sa(-1) del_quant_sa(-2) hoch_pi_fc(-!h) tief_pi_fc(-!i) wet_fc(-!j) rohr_std_fc(-!k) rohr_pers_fc(-!l) ar(1 to !m) ma(1 to !n)
if arma_!a!b!c!d!e!f!g!h!i!j!k!l!m!n.@aic<bestaic then
bestaic = arma_!a!b!c!d!e!f!g!h!i!j!k!l!m!n.@aic
!best_a = !a
!best_b = !b
!best_c = !c
!best_d = !d
!best_e = !e
!best_f = !f
!best_g = !g
!best_h = !h
!best_i = !i
!best_j = !j
!best_k = !k
!best_l = !l
!best_m = !m
!best_n = !n
endif
next
next
next
next
next
next
next
next
next
next
next
next
next
next
table bestmodel
bestmodel(1,1) = !best_a
bestmodel(1,2) = !best_b
bestmodel(1,3) = !best_c
bestmodel(1,4) = !best_d
bestmodel(1,5) = !best_e
bestmodel(1,6) = !best_f
bestmodel(1,7) = !best_g
bestmodel(1,8) = !best_h
bestmodel(1,9) = !best_i
bestmodel(1,10) = !best_j
bestmodel(1,11) = !best_k
bestmodel(1,12) = !best_l
bestmodel(1,13) = !best_m
bestmodel(1,14) = !best_n
K