Select the optimal number of lags, given criteria
Determine the optimal number of lags for dynamic regression
lagSelect(y, maxp, ic)
y
: A univariate time series datamaxp
: the max number of lagsic
: Information criteria, either "AIC" or "BIC"Information criteria "AIC" and "BIC" use the R built-in functions.
It returns an integer, indicating the optimal lags
Ho Tsung-wu tsungwu@ntnu.edu.tw, College of Management, National Taiwan Normal University.
#library(pdR) #data(inf19) #y<-inf19[,1] #lagSelect(y,maxp=25,ic="BIC")
Useful links