Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

post_coint_kls

Posterior Draw for Cointegration Models


Description

Produces a draw of coefficients for cointegration models 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(
  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 \times T matrix of differenced endogenous variables.

beta

a M \times r cointegration matrix β.

w

a M \times T matrix of variables in the cointegration term.

sigma_i

an inverse of the K \times K variance-covariance matrix.

v_i

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

p_tau_i

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

g_i

a K \times K matrix.

x

a N \times T matrix of differenced regressors and unrestricted deterministic terms.

gamma_mu_prior

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

gamma_v_i_prior

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

Details

The function produces posterior draws of the coefficient matrices α, β and Γ for the model

y_{t} = α β^{\prime} w_{t-1} + Γ z_{t} + u_{t},

where y_{t} is a K-dimensional vector of differenced endogenous variables. w_{t} is an M \times 1 vector of variables in the cointegration term, which include lagged values of endogenous and exogenous variables in levels and restricted deterministic terms. z_{t} is an N-dimensional vector of differenced endogenous and exogenous explanatory variabes as well as unrestricted deterministic terms. The error term is u_t \sim Σ.

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

\overline{V}_{α} = ≤ft[≤ft(v^{-1} (β^{\prime} P_{τ}^{-1} β) \otimes G_{-1}\right) + ≤ft(ZZ^{\prime} \otimes Σ^{-1} \right) \right]^{-1}

and the posterior mean by

\overline{α} = \overline{V}_{α} + vec(Σ^{-1} Y Z^{\prime}),

where Y is a K \times T matrix of differenced endogenous variables and Z = β^{\prime} W with W as an M \times T matrix of variables in the cointegration term.

For a given prior mean vector \underline{Γ} and prior covariance matrix \underline{V_{Γ}} the posterior covariance matrix of non-cointegration coefficients in Γ is obtained by

\overline{V}_{Γ} = ≤ft[ \underline{V}_{Γ}^{-1} + ≤ft(X X^{\prime} \otimes Σ^{-1} \right) \right]^{-1}

and the posterior mean by

\overline{Γ} = \overline{V}_{Γ} ≤ft[ \underline{V}_{Γ}^{-1} \underline{Γ} + vec(Σ^{-1} Y X^{\prime}) \right],

where X is an M \times 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

\overline{V}_{B} = ≤ft[≤ft(A^{\prime} G^{-1} A \otimes v^{-1} P_{τ}^{-1} \right) + ≤ft(A^{\prime} Σ^{-1} A \otimes WW^{\prime} \right) \right]^{-1}

and the posterior mean by

\overline{B} = \overline{V}_{B} + vec(W Y_{B}^{-1} Σ^{-1} A),

where Y_{B} = Y - Γ X and A = α (α^{\prime} α)^{-\frac{1}{2}}.

The final draws of α and β are calculated using β = B (B^{\prime} B)^{-\frac{1}{2}} and α = A (B^{\prime} B)^{\frac{1}{2}}.

Value

A named list containing the following elements:

alpha

a draw of the K \times r loading matrix.

beta

a draw of the M \times r cointegration matrix.

Pi

a draw of the K \times M cointegration matrix Π = α β^{\prime}.

Gamma

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

References

Koop, G., León-González, R., & Strachan R. W. (2010). Efficient posterior simulation for cointegrated models with priors on the cointegration space. Econometric Reviews, 29(2), 224-242. doi: 10.1080/07474930903382208

Examples

# Load data
data("e6")

# Generate model data
temp <- gen_vec(e6, p = 1, r = 1)
y <- t(temp$data$Y)
ect <- t(temp$data$W)

k <- nrow(y) # Endogenous variables
tt <- ncol(y) # Number of observations

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

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

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

bvartools

Bayesian Inference of Vector Autoregressive Models

v0.2.0
GPL (>= 2)
Authors
Franz X. Mohr [aut, cre]
Initial release
2021-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.