View source: R/post_normal_covar_tvp.R
post_normal_covar_tvp | R Documentation |
Produces posterior draws of time varying error covariance coefficients.
post_normal_covar_tvp(y, u_omega_i, v_sigma_i, psi_init)
y |
a |
u_omega_i |
matrix of error variances of the measurement equation.
Either a |
v_sigma_i |
matrix of error variances of the state equation.
Either an |
psi_init |
a vector of inital values of the state equation. |
For the multivariate model A_{0,t} 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,t}
similar as in
Primiceri (2005), i.e., using
y_t = Z_t \psi_t + 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
.
The algorithm of Chan and Jeliazkov (2009) is used to obtain time varying coefficients.
A matrix.
Chan, J., & Jeliazkov, I. (2009). Efficient simulation and integrated likelihood estimation in state space models. International Journal of Mathematical Modelling and Numerical Optimisation, 1(1/2), 101–120. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1504/IJMMNO.2009.030090")}
Primiceri, G. E. (2005). Time varying structural vector autoregressions and monetary policy. The Review of Economic Studies, 72(3), 821–852. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1467-937X.2005.00353.x")}
# Load example data
data("e1")
y <- log(t(e1))
# Generate artificial draws of other matrices
u_omega_i <- diag(1, 3)
v_sigma_i <- diag(1000, 3)
psi_init <- matrix(0, 3)
# Obtain posterior draw
post_normal_covar_tvp(y, u_omega_i, v_sigma_i, psi_init)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.