retrieving lags selected by AIC/BIC

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

retrieving lags selected by AIC/BIC

Postby maragloria » Fri Jul 28, 2017 9:02 am

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!

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

Re: retrieving lags selected by AIC/BIC

Postby EViews Gareth » Fri Jul 28, 2017 9:23 am

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

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: retrieving lags selected by AIC/BIC

Postby maragloria » Fri Jul 28, 2017 1:07 pm

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.

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

Re: retrieving lags selected by AIC/BIC

Postby EViews Gareth » Fri Jul 28, 2017 1:12 pm

What's the estimation specification?
Follow us on Twitter @IHSEViews

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: retrieving lags selected by AIC/BIC

Postby maragloria » Fri Jul 28, 2017 1:32 pm

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 "w-pooled" methods (and greater number of lags & leads) to check if matters; I still got NA.

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

Re: retrieving lags selected by AIC/BIC

Postby EViews Glenn » Fri Jul 28, 2017 4:16 pm

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 non-panel 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 non-grouped 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 built-in DOLS and compute your own likelihoods.

Going forward, we'll give this issue additional thought.

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: retrieving lags selected by AIC/BIC

Postby maragloria » Fri Jul 28, 2017 5:09 pm

Thank you for the reply, I'll use the residuals option.

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: retrieving lags selected by AIC/BIC

Postby maragloria » Tue Aug 01, 2017 9:14 am

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.

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 re-parametration?

Thanks for your attention.

[img]
graph.jpg
[/img]
[img]
table1.jpg
[/img]
[img]
table2.jpg
[/img]
Attachments
table1.jpg
table1.jpg (104.96 KiB) Viewed 9014 times
graph.jpg
graph.jpg (45.58 KiB) Viewed 9014 times
table2.jpg
table2.jpg (126.29 KiB) Viewed 9014 times

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

Re: retrieving lags selected by AIC/BIC

Postby EViews Gareth » Tue Aug 01, 2017 9:32 am

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 re-estimate 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

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: retrieving lags selected by AIC/BIC

Postby maragloria » Tue Aug 01, 2017 9:35 am

Got it! Thank you very much.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 25 guests