Learn Data & AI Skills | 50% off
Get 50% off unlimited learning

bvartools (version 0.0.1)

post_coint_kls_sur: Posterior Draw for Cointegration Models

Description

Produces a draw of coefficients for cointegration models in SUR form with a prior on the cointegration space as proposed in Koop et al. (2010) and a draw of non-cointegration coefficients from a normal density.

Usage

post_coint_kls_sur(y, beta, w, sigma_i, v_i, p_tau_i, g_i, x = NULL,
  gamma_mu_prior = NULL, gamma_V_i_prior = NULL)

Arguments

y

a K×T matrix of differenced endogenous variables.

beta

a M×r cointegration matrix β.

w

a M×T matrix of variables in the cointegration term.

sigma_i

the inverse of the constant K×K error variance-covariance matrix. For time varying variance-covariance matrics a KT×K can be provided.

v_i

a numeric between 0 and 1 specifying the shrinkage of the cointegration space prior.

p_tau_i

an inverted M×M matrix specifying the central location of the cointegration space prior of sp(β).

g_i

a K×K or KT×K matrix.

x

a KT×NK matrix of differenced regressors and unrestricted deterministic terms.

gamma_mu_prior

a KN×1 prior mean vector of non-cointegration coefficients.

gamma_V_i_prior

an inverted KN×KN prior covariance matrix of non-cointegration coefficients.

Value

A named list containing the following elements:

alpha

a draw of the K×r loading matrix.

beta

a draw of the M×r cointegration matrix.

Pi

a draw of the K×M cointegration matrix Π=αβ.

Gamma

a draw of the K×N coefficient matrix for non-cointegration parameters.

Details

The function produces posterior draws of the coefficient matrices α, β and Γ for the model yt=αβwt1+Γzt+ut, where yt is a K-dimensional vector of differenced endogenous variables. wt is an M×1 vector of variables in the cointegration term, which include lagged values of endogenous and exogenous variables in levels and restricted deterministic terms. zt is an N-dimensional vector of differenced endogenous and exogenous explanatory variabes as well as unrestricted deterministic terms. The error term is utΣ.

Draws of the loading matrix α are obtained using the prior on the cointegration space as proposed in Koop et al. (2010). The posterior covariance matrix is Vα=[(v1(βPτ1β)G1)+(ZZΣ1)]1 and the posterior mean by α=Vα+vec(Σ1YZ), where Y is a K×T matrix of differenced endogenous variables and Z=βW with W as an M×T matrix of variables in the cointegration term.

For a given prior mean vector Γ and prior covariance matrix VΓ the posterior covariance matrix of non-cointegration coefficients in Γ is obtained by VΓ=[VΓ1+(XXΣ1)]1 and the posterior mean by Γ=VΓ[VΓ1Γ+vec(Σ1YX)], where X is an M×T matrix of explanatory variables, which do not enter the cointegration term.

Draws of the cointegration matrix β are obtained using the prior on the cointegration space as proposed in Koop et al. (2010). The posterior covariance matrix of the unrestricted cointegration matrix B is VB=[(AG1Av1Pτ1)+(AΣ1AWW)]1 and the posterior mean by B=VB+vec(WYB1Σ1A), where YB=YΓX and A=α(αα)12.

The final draws of α and β are calculated using β=B(BB)12 and α=A(BB)12.

References

Koop, G., Le<U+00F3>n-Gonz<U+00E1>lez, R., & Strachan R. W. (2010). Efficient posterior simulation for cointegrated models with priors on the cointegration space. Econometric Reviews, 29(2), 224-242. https://doi.org/10.1080/07474930903382208

Examples

Run this code
# NOT RUN {
data("e6")
temp <- gen_vec(e6, p = 0)
y <- temp$Y
ect <- temp$W

k <- nrow(y)
t <- ncol(y)

# Initial value of Sigma
sigma <- tcrossprod(y) / t
sigma_i <- solve(sigma)

# Initial values of beta
beta <- matrix(c(1, -4), k)

# Draw parameters
coint <- post_coint_kls_sur(y = y, beta = beta, w = ect,
                            sigma_i = sigma_i, v_i = 0, p_tau_i = diag(1, 1),
                            g_i = sigma_i)

# }

Run the code above in your browser using DataLab