Vector Autoregressive Model Input
gen_var
produces the input for the estimation of a vector autoregressive (VAR) model.
gen_var( data, p = 2, exogen = NULL, s = NULL, deterministic = "const", seasonal = FALSE, structural = FALSE, iterations = 50000, burnin = 5000 )
data |
a time-series object of endogenous variables. |
p |
an integer vector of the lag order (default is |
exogen |
an optional time-series object of external regressors. |
s |
an optional integer vector of the lag order of the external regressors (default is |
deterministic |
a character specifying which deterministic terms should
be included. Available values are |
seasonal |
logical. If |
structural |
logical indicating whether data should be prepared for the estimation of a structural VAR model. |
iterations |
an integer of MCMC draws excluding burn-in draws (defaults to 50000). |
burnin |
an integer of MCMC draws used to initialize the sampler (defaults to 5000). These draws do not enter the computation of posterior moments, forecasts etc. |
The function produces the data matrices for vector autoregressive (VAR) models, which can also include unmodelled, non-deterministic variables:
A_0 y_t = ∑_{i=1}^{p} A_i y_{t - i} + ∑_{i=0}^{s} B_i x_{t - i} + C D_t + u_t,
where y_t is a K-dimensional vector of endogenous variables, A_0 is a K \times K coefficient matrix of contemporaneous endogenous variables, A_i is a K \times K coefficient matrix of endogenous variables, x_t is an M-dimensional vector of exogenous regressors and B_i its corresponding K \times M coefficient matrix. D_t is an N-dimensional vector of deterministic terms and C its corresponding K \times N coefficient matrix. p is the lag order of endogenous variables, s is the lag order of exogenous variables, and u_t is an error term.
If an integer vector is provided as argument p
or s
, the function will
produce a distinct model for all possible combinations of those specifications.
An object of class 'bvarmodel'
, which contains the following elements:
data |
A list of data objects, which can be used for posterior simulation. Element
|
model |
A list of model specifications. |
Lütkepohl, H. (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.
# Load data data("e1") e1 <- diff(log(e1)) # Generate model data data <- gen_var(e1, p = 0:2, deterministic = "const")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.