Skip to contents

Fits VAR models for lag orders 1 through pmax and returns the lag length that minimises each of three information criteria.

Usage

fAICBIC(y, pmax, c, exog = NULL)

Arguments

y

A T x N matrix of endogenous variables (T observations, N series).

pmax

An integer specifying the maximum VAR lag order to consider.

c

An integer (0 or 1) indicating whether to include a constant term (1 = include, 0 = exclude).

exog

An optional T x M matrix of exogenous variables. Default is NULL.

Value

A list with three integer elements: aic — optimal lag length by Akaike IC; bic — optimal lag length by Bayesian IC; hq — optimal lag length by Hannan-Quinn IC.

Details

For each candidate lag order p the residual covariance Sigma = (e'e)/T is computed and the three criteria are evaluated as:

AIC = log(det(Sigma)) + 2 * (p*N^2 + N + M) / T

BIC = log(det(Sigma)) + log(T) * (p*N^2 + N + M) / T

HQ = log(det(Sigma)) + 2 * log(log(T)) * (p*N^2 + N + M) / T

where M is the number of exogenous variables.

See also

Examples

if (FALSE) { # \dontrun{
set.seed(123)
y      <- matrix(rnorm(200), ncol = 2)
result <- fAICBIC(y, pmax = 10, c = 1)
result$aic
result$bic
} # }