est.VARX.ls
Estimate a VAR TSmodel
Description
Estimate a VAR TSmodel with (optionally) an exogenous input and
(optionally) a trend.
Usage
est.VARX.ls(data, subtract.means=F, re.add.means=T, standardize=F,
unstandardize=T, trend=F, max.lag=NULL, lag.weight=1.0, warn=T)
Required Arguments
- model
-
An object with the structure of an object of class TSdata (see TSdata).
Optional Arguments
- subtract.means
-
If T subtract the means from the data before estimation.
- re.add.means
-
If T and subtract.means is T then the mean is added back to the data and
the model is adjusted for the non-zero mean data when returned.
- standardize
-
If T divide each series by its sample standard deviation before estimation.
Note that the mean is not subtracted unless subtract.means is T.
- unstandardize
-
If T and standardize is T then the returned model is adjusted to correspond
to the original data.
- trend
-
If T a trend is estimated.
- max.lag
-
Number of lags to be used.
- lag.weight
-
Weight between 0 and 1 to be applied to lagged data. Lower weights mean lagged
data is less important (more noisy).
- warn
- If TRUE a warning message is issued when missing data (NA) is detected and
the model predictions are reconstructed from the lsfit residuals.
Value
A VAR model in an object of class TSestModel.
Details
A VAR model is fitted by least squares regression using lsfit. The
argument max.lag determines the number of lags. If a trend is not
estimated the function est.VARX.ar 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.
REFERENCES
P.D.Gilbert (1992) State Space and ARMA models: An overview of
estimation and reduction.
See Also
Examples
model <- est.VARX.ls(data)
return to Table of Contents