gen_var
produces the input for the estimation of a vector autoregressive (VAR) model.
gen_var(data, p = 2, exogen = NULL, s = 2, deterministic = "const",
seasonal = FALSE)
a time-series object of endogenous variables.
an integer of the lag order (default is p = 2
).
an optional time-series object of external regressors.
an optional integer of the lag order of the exogenous variables (default is s = 2
).
a character specifying which deterministic terms should
be included. Available values are "none"
, "const"
(default),
"trend"
, and "both"
.
logical. If TRUE
, seasonal dummy variables are
generated. The amount of dummies depends on the frequency of the
time-series object provided in data
.
A list containing the following elements:
a matrix of endogenous variables.
a matrix of regressor variables.
The function produces the variable matrices of a vector autoregressive (VAR)
model, which can also include exogenous variables:
In matrix notation the above model can be written as
gen_var
generates the matrices
L<U+00FC>tkepohl, H. (2007). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.
# NOT RUN {
data("e1")
e1 <- diff(log(e1))
data <- gen_var(e1, p = 2, deterministic = "const")
# }
Run the code above in your browser using DataLab