Hello,
I'm using EViews 9.5 and doing panel cointegration estimations using DOLS and PMG/ARDL.
Is there a easy way to retrieve the lags selected by AIC/BIC using a program?
Thanks!
retrieving lags selected by AIC/BIC
Moderators: EViews Gareth, EViews Jason, EViews Moderator

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11253
 Joined: Tue Sep 16, 2008 5:38 pm
Re: retrieving lags selected by AIC/BIC
Unfortunately there isn't an easy way to retrieve it other than by freezing the equation output into a table and parsing the results.
Follow us on Twitter @IHSEViews

 Posts: 79
 Joined: Tue Jun 29, 2010 7:09 am
Re: retrieving lags selected by AIC/BIC
Hello Gareth,
I was doing that but wondered if there was a better way to do it.
I'm thinking of doing something else, saving the AIC to make my own comparisons. I just realised that when using panel DOLS the @aic command returns NA (eqdols.@aic). Is that normal?
Thanks again.
I was doing that but wondered if there was a better way to do it.
I'm thinking of doing something else, saving the AIC to make my own comparisons. I just realised that when using panel DOLS the @aic command returns NA (eqdols.@aic). Is that normal?
Thanks again.

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11253
 Joined: Tue Sep 16, 2008 5:38 pm
Re: retrieving lags selected by AIC/BIC
What's the estimation specification?
Follow us on Twitter @IHSEViews

 Posts: 79
 Joined: Tue Jun 29, 2010 7:09 am
Re: retrieving lags selected by AIC/BIC
equation eqdols.cointreg(method=dols, lag=1, lead=1, panmethod=grouped) neerln cpieff nfa totln prodeff gdebteff
!aictemp=_eqdols.@aic
I also used the "pooled" and "wpooled" methods (and greater number of lags & leads) to check if matters; I still got NA.
!aictemp=_eqdols.@aic
I also used the "pooled" and "wpooled" methods (and greater number of lags & leads) to check if matters; I still got NA.

 EViews Developer
 Posts: 2527
 Joined: Wed Oct 15, 2008 9:17 am
Re: retrieving lags selected by AIC/BIC
We aren't computing the log likelihood for any of the nonstationary regression models as the notion of a likelihood is problematic in some of these settings. Arguably, we could compute a measure for the nonpanel DOLS as I believe this estimator is asymptotically MLE apart from estimation of some parameters that are asymptotically zero. But we didn't think people really wanted likelihoods in this setting so we didn't compute them. Further, this gets tricky when using the grouped method.
For now, for nongrouped methods, you can compute the DOLS using standard regression tools and get the likelihood from those equations, or you can take the residuals from the builtin DOLS and compute your own likelihoods.
Going forward, we'll give this issue additional thought.
For now, for nongrouped methods, you can compute the DOLS using standard regression tools and get the likelihood from those equations, or you can take the residuals from the builtin DOLS and compute your own likelihoods.
Going forward, we'll give this issue additional thought.

 Posts: 79
 Joined: Tue Jun 29, 2010 7:09 am
Re: retrieving lags selected by AIC/BIC
Thank you for the reply, I'll use the residuals option.

 Posts: 79
 Joined: Tue Jun 29, 2010 7:09 am
Re: retrieving lags selected by AIC/BIC
Hello Gareth,
I run the following code to retrieve the lags selected by AIC, using ARDL/PMG panel estimator.
The code searches for the minimum AIC.
I noticed the following:
 The code above selected (2,2) as the best lag with an AIC = 4.446
 EViews selected a lag length of (4,2) with an AIC of 4.315.
 However, the "model selection summary" (see graph), gives an AIC of 4.629 for the (4,2) lag lenth and 4.616 for my selected lag length of (2,2)
Why is the AIC changing from the ones presented in the estimation results to the ones in the "model selection summary"?
Is that because the model is being selected prior to the ECM reparametration?
Thanks for your attention.
[img] [/img]
[img] [/img]
[img] [/img]
I run the following code to retrieve the lags selected by AIC, using ARDL/PMG panel estimator.
The code searches for the minimum AIC.
Code: Select all
'run ARDL/PMG estimation
!maxlagcrit=4
!mininfocrit=10
for !lagdep=1 to !maxlagcrit
for !lagexp=1 to !maxlagcrit
equation _eqardl_aic.ardl(fixed,deplags=!lagdep,reglags=!lagexp) G
if _eqardl_aic.@aic<!mininfocrit then
!bestlagdep=!lagdep
!bestlagexp=!lagexp
!mininfocrit=_eqardl_aic.@aic
endif
next
next
equation _eqardl_aic.ardl(fixed,deplags=!bestlagdep,reglags=!bestlagexp) G
I noticed the following:
 The code above selected (2,2) as the best lag with an AIC = 4.446
 EViews selected a lag length of (4,2) with an AIC of 4.315.
 However, the "model selection summary" (see graph), gives an AIC of 4.629 for the (4,2) lag lenth and 4.616 for my selected lag length of (2,2)
Why is the AIC changing from the ones presented in the estimation results to the ones in the "model selection summary"?
Is that because the model is being selected prior to the ECM reparametration?
Thanks for your attention.
[img] [/img]
[img] [/img]
[img] [/img]
 Attachments

 table1.jpg (104.96 KiB) Viewed 157 times

 graph.jpg (45.58 KiB) Viewed 157 times

 table2.jpg (126.29 KiB) Viewed 157 times

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11253
 Joined: Tue Sep 16, 2008 5:38 pm
Re: retrieving lags selected by AIC/BIC
It is probably due to dropping of lags.
When performing model selection up to, say, 4 lags, each of the 4 models (1,2,3,4) have to be tested on the same sample  so you have to drop four observations at the start for each estimation.
Then if you selected 2 as the the best model you reestimate a 2 lag model this time only dropping two observations. That means that the information criteria from the final estimation is (slightly, hopefully) different from that used during model selection.
When performing model selection up to, say, 4 lags, each of the 4 models (1,2,3,4) have to be tested on the same sample  so you have to drop four observations at the start for each estimation.
Then if you selected 2 as the the best model you reestimate a 2 lag model this time only dropping two observations. That means that the information criteria from the final estimation is (slightly, hopefully) different from that used during model selection.
Follow us on Twitter @IHSEViews

 Posts: 79
 Joined: Tue Jun 29, 2010 7:09 am
Re: retrieving lags selected by AIC/BIC
Got it! Thank you very much.
Who is online
Users browsing this forum: Baidu [Spider] and 3 guests