Learn R Programming

BigVAR (version 1.0)

VARXFit: Fit a VAR or VARX model by least squares

Description

Fit a VAR or VARX model by least squares

Usage

VARXFit(Y, p, IC, VARX = NULL)

Arguments

Y
a $t \times k$ multivariate time series
p
maximum lag order
IC
Information criterion indicator, if set to NULL, it will fit a least squares VAR(X) of orders p and s. Otherwise, if set to "AIC" or "BIC" it return the model with lag orders that minimize the given IC.
VARX
a list of VARX specifications (as in constructModel (or NULL )

Value

  • Returns a list with four entries:
    • "Bhat"
    {Estimated $k\times kp+ms$ coefficient matrix}
  • "SigmaUEstimated $k\times k$ residual covariance matrix
  • "phat"Selected lag order for VAR component
  • "shat"Selected lag order for VARX component

Details

This function uses a modified form of the least squares technique proposed by Neumaier and Schneider (2001). It fits a least squares VAR or VARX via a QR decomposition that does not require explicit matrix inversion. This results in improved computational performance as well as numerical stability over the conventional least squares approach.

References

Neumaier, Arnold, and Tapio Schneider. "Estimation of parameters and eigenmodes of multivariate autoregressive models." ACM Transactions on Mathematical Software (TOMS) 27.1 (2001): 27-57.

See Also

constructModel, cv.BigVAR

Examples

Run this code
data(Y)
# fit a VAR_3(3)
mod <- VARXFit(Y,3,NULL,NULL)
# fit a VAR_3 with p= 6 and lag selected according to AIC
modAIC <- VARXFit(Y,6,"AIC",NULL)
# Fit a VARX_{2,1} with p=6, s=4 and lags selected by BIC
modXBIC <- VARXFit(Y,6,"BIC",list(k=2,s=4))

Run the code above in your browser using DataLab