gen_vec {bvartools} | R Documentation |
Vector Error Correction Model Input
Description
gen_vec
produces the input for the estimation of a vector error correction (VEC) model.
Usage
gen_vec(
data,
p = 2,
exogen = NULL,
s = 2,
r = NULL,
const = NULL,
trend = NULL,
seasonal = NULL,
structural = FALSE,
tvp = FALSE,
sv = FALSE,
fcst = NULL,
iterations = 50000,
burnin = 5000
)
Arguments
data |
a time-series object of endogenous variables. |
p |
an integer vector of the lag order of the series in the (levels) VAR. Thus, the
resulting model's lag will be |
exogen |
an optional time-series object of external regressors. |
s |
an optional integer vector of the lag order of the exogenous variables of the series
in the (levels) VAR. Thus, the resulting model's lag will be |
r |
an integer vector of the cointegration rank. See 'Details'. |
const |
a character specifying whether a constant term enters the error correction
term ( |
trend |
a character specifying whether a trend term enters the error correction
term ( |
seasonal |
a character specifying whether seasonal dummies should be included in the error
correction term ( |
structural |
logical indicating whether data should be prepared for the estimation of a structural VAR model. |
tvp |
logical indicating whether the model parameters are time varying. |
sv |
logical indicating whether time varying error variances should be estimated by employing a stochastic volatility algorithm. |
fcst |
integer. Number of observations saved for forecasting evaluation. |
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. |
Details
The function produces the variable matrices of vector error correction (VEC) models, which can also include exogenous variables:
where
is a
vector of differenced endogenous variables,
is a
vector of cointegration variables,
is a
matrix of cointegration parameters,
is a
coefficient matrix of endogenous variables,
is a
vector of differenced exogenous regressors,
is a
coefficient matrix of exogenous regressors,
is a
vector of deterministic terms, and
is a
coefficient matrix of deterministic terms
that do not enter the cointegration term.
is the lag order of endogenous variables and
is the lag
order of exogenous variables of the corresponding VAR model.
is a
error term.
If an integer vector is provided as argument p
, s
or r
, the function will
produce a distinct model for all possible combinations of those specifications.
If tvp
is TRUE
, the respective coefficients
of the above model are assumed to be time varying. If sv
is TRUE
,
the error covariance matrix is assumed to be time varying.
Value
An object of class 'bvecmodel'
, 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. |
References
Lütkepohl, H. (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.
Examples
# Load data
data("e6")
# Generate model data
data <- gen_vec(e6, p = 4, const = "unrestricted", season = "unrestricted")