Learn R Programming

pdR (version 1.9.3)

lagSelect: Select the optimal number of lags, given criteria

Description

Determine the optimal number of lags for dynamic regression

Usage

lagSelect(y, maxp, ic)

Value

It returns an integer, indicating the optimal lags

Arguments

y

A univariate time series data

maxp

the max number of lags

ic

Information criteria, either "AIC" or "BIC"

Author

Ho Tsung-wu <tsungwu@ntnu.edu.tw>, College of Management, National Taiwan Normal University.

Details

Information criteria "AIC" and "BIC" use the R built-in functions.

Examples

Run this code
#library(pdR)
#data(inf19)
#y<-inf19[,1]
#lagSelect(y,maxp=25,ic="BIC")

Run the code above in your browser using DataLab