Estimate a VAR TSmodel


Estimate a VAR TSmodel with (optionally) an exogenous input and (optionally) a trend.


    estVARXls(data, subtract.means=FALSE, re.add.means=TRUE, standardize=FALSE, 
     unstandardize=TRUE, max.lag=NULL, trend=FALSE, lag.weight=1.0, warn=TRUE) 



A TSdata object.


If TRUE subtract the means from the data before estimation.


If TRUE and subtract.means is TRUE then the mean is added back to the data and the model is adjusted for the non-zero mean data when returned.


If TRUE divide each series by its sample standard deviation before estimation. Note that the mean is not subtracted unless subtract.means is TRUE.


If TRUE and standardize is TRUE then the returned model is adjusted to correspond to the original data.


If TRUE a trend is estimated.


Number of lags to be used.


Weight between 0 and 1 to be applied to lagged data. Lower weights mean lagged data is less important (more noisy).


If TRUE a warning message is issued when missing data (NA) is detected and the model predictions are reconstructed from the lsfit residuals.


A VAR model is fitted by least squares regression using lsfit. The argument max.lag determines the number of lags. If it is not specified then six lags are used. This is an exceedingly naive approach, so the max.lag argument really should be specified (or see bft for a more complete approach to model selection.) If a trend is not estimated the function estVARXar may be preferred. Missing data is allowed in lsfit, but not (yet) by ARMA which generates the model predictions, etc., based on the estimated model and the data. (This is done to ensure the result is consistent with other estimation techniques.) In the case of missing data ARMA is not used and the model predictions, etc., are generated by adding the data and the lsfit residual. This is slightly different from using ARMA, especially with respect to initial conditions.


A TSestModel object containing a TSmodel object which is a VAR model.


Gilbert, P. D. (1993) State space and ARMA models: An overview of the equivalence. Working paper 93-4, Bank of Canada. Available at

Gilbert, P. D. (1995) Combining VAR Estimation and State Space Model Reduction for Simple Good Predictions. J. of Forecasting: Special Issue on VAR Modelling. 14:229–250.

See Also

estSSfromVARX estSSMittnik bft estVARXar estMaxLik


    data("", package="dse")
    model <- estVARXls(

Want to suggest features or report bugs for Use the GitHub issue tracker. Vote for new features on Trello.

comments powered by Disqus