Optimal AIC-based max lag ADF test

For questions regarding programming in the EViews programming language.

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

pka
Posts: 23
Joined: Wed Apr 25, 2018 1:54 pm

Optimal AIC-based max lag ADF test

Postby pka » Tue Aug 13, 2019 6:17 am

Hello,

Is there a command to retrieve the optimal max lag order based on a given information criterion when running the ADF test?

I need to carry out the ADF test on a large number of series. Next, for each series, I need to record the optimal lag order automatically suggested by say the AIC.

I tried to loop over the relevant cell content of the ADF table output but I am having a difficulty retrieving the lag order because the cell contains both strings and the need number of lag.

Thanks for your help.

Regards,

PK

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

Re: Optimal AIC-based max lag ADF test

Postby EViews Gareth » Tue Aug 13, 2019 8:12 am

There's an undocumented option (that we really need to document...) to save all the useful stuff from the test.

Code: Select all

myseries.uroot(save=myvector)

will save the useful statistics from the unit root test into the vector myvector. The last element contains the number of selected lags.
Follow us on Twitter @IHSEViews

pka
Posts: 23
Joined: Wed Apr 25, 2018 1:54 pm

Re: Optimal AIC-based max lag ADF test

Postby pka » Tue Aug 13, 2019 11:47 am

Many thanks indeed Dear Gareth!

pka
Posts: 23
Joined: Wed Apr 25, 2018 1:54 pm

Re: Optimal AIC-based max lag ADF test

Postby pka » Fri Aug 16, 2019 10:32 am

pka wrote:Many thanks indeed Dear Gareth!

Hello Gareth,

I see the last element of the vector refers to the maximum lag length used.

Is it possible to retrieve the retained lag order for the test?

Thanks,

PK

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

Re: Optimal AIC-based max lag ADF test

Postby EViews Gareth » Fri Aug 16, 2019 10:48 am

I think that's the 2nd element?
Follow us on Twitter @IHSEViews

pka
Posts: 23
Joined: Wed Apr 25, 2018 1:54 pm

Re: Optimal AIC-based max lag ADF test

Postby pka » Fri Aug 16, 2019 11:49 am

EViews Gareth wrote:I think that's the 2nd element?

Yes indeed. It is the one.
Many thanks.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 19 guests