Construct a VAR or VARX lag matrix
VARXLagCons(Y, X = NULL, p, s = 0, oos = FALSE, contemp = FALSE)
list with two entries:
'Z'
'Y'adjusted
a
a
Endogenous Lag order
exogenous lag order (default zero)
indicator as to whether the data should be constructed for out of sample prediction (i.e. last available entries of Y as final lags default FALSE)
indicator as to whether to use contemporaneous exogenous predictors (for example, if exogenous series become available before exogenous default FALSE).
This function is not required unless you which to design your own cross validation routine.
See page 15 of Lutkepohl, 'A New Introduction to Multiple Time Series Analysis
MultVarSim
data(Y)
# construct VAR lag matrix with p=4
ZZ<-VARXLagCons(Y,X=NULL,p=4,s=0)
Run the code above in your browser using DataLab