Learn R Programming

bvartools (version 0.2.4)

post_normal_covar_const: Posterior Simulation of Error Covariance Coefficients

Description

Produces posterior draws of constant error covariance coefficients.

Usage

post_normal_covar_const(y, u_omega_i, prior_mean, prior_covariance_i)

Value

A matrix.

Arguments

y

a \(K \times T\) matrix of data with \(K\) as the number of endogenous variables and \(T\) the number of observations.

u_omega_i

matrix of error variances of the measurement equation. Either a \(K \times K\) matrix for constant variances or a \(KT \times KT\) matrix for time varying variances.

prior_mean

vector of prior means. In case of TVP, this vector is used as initial condition.

prior_covariance_i

inverse prior covariance matrix. In case of TVP, this matrix is used as initial condition.

Details

For the multivariate model \(A_0 y_t = u_t\) with \(u_t \sim N(0, \Omega_t)\) the function produces a draw of the lower triangular part of \(A_0\) similar as in Primiceri (2005), i.e., using $$y_t = Z_t \psi + u_t,$$ where $$Z_{t} = \begin{bmatrix} 0 & \dotsm & \dotsm & 0 \\ -y_{1, t} & 0 & \dotsm & 0 \\ 0 & -y_{[1,2], t} & \ddots & \vdots \\ \vdots & \ddots & \ddots & 0 \\ 0 & \dotsm & 0 & -y_{[1,...,K-1], t} \end{bmatrix}$$ and \(y_{[1,...,K-1], t}\) denotes the first to \((K-1)\)th elements of the vector \(y_t\).

References

Primiceri, G. E. (2005). Time varying structural vector autoregressions and monetary policy. The Review of Economic Studies, 72(3), 821--852. tools:::Rd_expr_doi("10.1111/j.1467-937X.2005.00353.x")

Examples

Run this code
# Load example data
data("e1")
y <- log(t(e1))

# Generate artificial draws of other matrices
u_omega_i <- diag(1, 3)
prior_mean <- matrix(0, 3)
prior_covariance_i <- diag(0, 3)

# Obtain posterior draw
post_normal_covar_const(y, u_omega_i, prior_mean, prior_covariance_i)

Run the code above in your browser using DataLab