Learn R Programming

pdR (version 1.9.3)

selPabic: Selection of lags.

Description

Lagged coefficient estimates are kept if they meet the inequality condition of AIC or BIC.

Usage

selPabic(lmdet, type, Pmax = NULL)

Value

This function returns the lag orders.

Arguments

lmdet

Object of lm()

type

Take the value of "aic" or "bic".

Pmax

The maximum number of lag orders.

Author

Ho Tsung-wu <tsungwu@ntnu.edu.tw>, modifed from Javier Lopez-de-Lacalle

Details

This is an internal function used for HEGY.test(). Beginning with pamx, the lag order will be drop if its inclusion worsens the minimum condition. Hence, they may not be a regular sequence. For example, for pmax=10, the selected lags may look like (1,4,5,8,9), rather than 1,2,3,...10.

References

Javier Lopez-de-Lacalle in https://github.com/cran/uroot/blob/master/R/hegy.R

Examples

Run this code
data(inf_Q)
y=inf_Q[,1]
hegy.out<-HEGY.test(wts=y, itsd=c(1,0,c(1:3)),regvar=0, selectlags=list(mode="aic", Pmax=12))
hegy.out$lagsorder
hegy.out$lagcoefs

Run the code above in your browser using DataLab