Estimates a VAR(p) model from data. The function's purpose is to be used before the ACtest
or archBootTest
functions, and doesn't have the same full functionality as for example the function VAR
in the vars
package.
VARfit(y, p = 1, const = TRUE, trend = FALSE, exogen = NULL, univariate = FALSE)
an N x K matrix containing the time series to be modeled.
the lag length of the VAR(p) process.
if TRUE
(default) the model will include a constant.
if TRUE
the model will include a trend.
a matrix or vector of exogenous variable(s). Must have the same number of rows as 'y' does.
if TRUE
univariate (i.e. an AR(p) model for each timeseries) estimates will also be printed.
a list of class "VARfit"
with the following slots:
the data matrix.
the lag length p
.
the the number of observations/rows in the time series 'y'.
the the number of variables in the time series 'y'.
TRUE
if the model included a constant.
TRUE
if the model included a trend.
the exogen variable(s).
the [N - p] x [Kp + numberOf(const, trend, dummy)] design matrix, where the lags of the y
matrix are appended.
how the function VARfit()
was called.
a matrix of the estimated parameters.
the [N - p] x K matrix of residuals.
a matrix of the estimated parameter for the univariate case (an AR(p) for each column in 'y').
the [N - p] x K matrix of residuals from the univariate (AR(p)) cases.
the 'univariate' argument.
the number of non-endogenous variables (i.e. the number of 'exogen' variables + const + trend).
who fitted the model and when.
computation time taken for the estimation.
ACtest
to test for error autocorrelations, and archBootTest
to test for ARCH errors.
# NOT RUN {
fit <- VARfit(y = VodafoneCDS, p = 3, const = TRUE, trend = FALSE)
# }
Run the code above in your browser using DataLab