gen_vec
produces the input for the estimation of a vector error correction (VEC) model.
gen_vec(
data,
p = 2,
exogen = NULL,
s = 2,
r = NULL,
const = NULL,
trend = NULL,
seasonal = NULL,
structural = FALSE,
iterations = 50000,
burnin = 5000
)
a time-series object of endogenous variables.
an integer vector of the lag order of the series in the (levels) VAR.
an optional time-series object of external regressors.
an optional integer vector of the lag order of the exogenous variables of the series in the (levels) VAR.
an integer vector of the cointegration rank.
a character specifying whether a constant term enters the error correction
term ("restricted"
) or the non-cointegration term as an "unrestricted"
variable.
If NULL
(default) no constant term will be added.
a character specifying whether a trend term enters the error correction
term ("restricted"
) or the non-cointegration term as an "unrestricted"
variable.
If NULL
(default) no constant term will be added.
a character specifying whether seasonal dummies should be included in the error
correction term ("restricted"
) or in the non-cointegreation term as "unrestricted"
variables. If NULL
(default) no seasonal terms will be added. The amount of dummy variables depends
on the frequency of the time-series object provided in data
.
logical indicating whether data should be prepared for the estimation of a structural VAR model.
an integer of MCMC draws excluding burn-in draws (defaults to 50000).
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.
An object of class 'bvecmodel'
, which contains the following elements:
A list of data objects, which can be used for posterior simulation. Element
Y
is a time-series object of dependent variables. Element W
is a timer-series
object of variables in the cointegration term and element X
is a time-series
object of variables that do not enter the cointegration term. Element SUR
contains a
matrix of element X
in its SUR form.
A list of model specifications.
The function produces the variable matrices of vector error correction (VEC) models, which can also include exogenous variables: $$\Delta y_t = \Pi w_t + \sum_{i=1}^{p-1} \Gamma_i \Delta y_{t - i} + \sum_{i=0}^{s-1} \Upsilon_i \Delta x_{t - i} + C^{UR} d^{UR}_t + u_t,$$ where \(\Delta y_t\) is a \(K \times 1\) vector of differenced endogenous variables, \(w_t\) is a \((K + M + N^{R}) \times 1\) vector of cointegration variables, \(\Pi\) is a \(K \times (K + M + N^{R})\) matrix of cointegration parameters, \(\Gamma_i\) is a \(K \times K\) coefficient matrix of endogenous variables, \(\Delta x_t\) is a \(M \times 1\) vector of differenced exogenous regressors, \(\Upsilon_i\) is a \(K \times M\) coefficient matrix of exogenous regressors, \(d^{UR}_t\) is a \(N \times 1\) vector of deterministic terms, and \(C^{UR}\) is a \(K \times N^{UR}\) coefficient matrix of deterministic terms that do not enter the cointegration term. \(p\) is the lag order of endogenous variables and \(s\) is the lag order of exogenous variables of the corresponding VAR model. \(u_t\) is a \(K \times 1\) 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.
L<U+00FC>tkepohl, H. (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.
# NOT RUN {
# Load data
data("e6")
# Generate model data
data <- gen_vec(e6, p = 4, const = "unrestricted", season = "unrestricted")
# }
Run the code above in your browser using DataLab