estVARXar: Estimate a VAR TSmodel

Description Usage Arguments Details Value References See Also Examples

View source: R/dse1.R


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


    estVARXar(data, subtract.means=FALSE,  re.add.means=TRUE, standardize=FALSE, 
         unstandardize=TRUE, aic=TRUE, max.lag=NULL, method="yule-walker", warn=TRUE)



A TSdata object.


If TRUE subtract the means from the data before estimation.


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


Note that the mean is not subtracted unless subtract.means is TRUE. A VAR model in an object of class TSestModel.


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


Passed to function ar.


The maximum number of lags that should be considered.


Passed to function ar.


If TRUE certain warning message are suppressed.


This function estimates a VAR model with exogenous variable using ar(). Residuals,etc, are calculated by evaluating the estimated model with ARMA. The procedure ar is used by combine exogeneous variables and endogenous variable and estimating as if all variables were endogenous. The estVARXar method does not support trend estimation (as in estVARXls).

If aic=TRUE the number of lags is determined by an AIC statistic (see ar). If an exogenous (input) variable is supplied the input and output are combined (i.e.- both treated as outputs) for estimation, and the resulting model is converted back by transposing the exogenous variable part of the polynomial and discarding inappropriate blocks. Residuals,etc, are calculated by evaluating the estimated model as a TSmodel/ARMA with the data (ie. residuals are not the residuals from the regression).

Note: ar uses a Yule-Walker approach (uses autocorrelations) so effectively the model is for data with means removed. Thus subtract.means does not make much difference and re.add.means must be TRUE to get back to a model for the original data.

The conventon for AR(0) and sign are changed to ARMA format. Data should be of class TSdata. The exog. variable is shifted so contemporaneous effects enter. the model for the exog. variable (as estimated by ar() is discarded.


A TSestModel object containing an ARMA TSmodel object. The model has no MA portion so it 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 estVARXls estMaxLik ar


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

dse documentation built on Aug. 6, 2017, 3:01 a.m.