covar_prepare_data | R Documentation |
Convenience function, which generates the input data for posterior simulation of covariance parameters.
covar_prepare_data(y, omega_i, k, tt, tvp)
y |
a |
omega_i |
a |
k |
an integer of the number of endogenous variables. |
tt |
an integer of the number of observations. |
tvp |
logical indicating if the SUR matrix with the values of regressors should be prepared for the estimation of constant or time varying parameters. |
For the model
y_t = Z_{t} a_t + u_t
with u_t \sim N(0, \Psi \Omega_{t} \Psi^{\prime})
and \Omega_{t}
as a diagonal matrix of error variances, the function produces
the input data for the posterior simulation of the lower triangular covariance coefficients
of \Psi
as presented in Primiceri (2005).
A list with three elements:
y |
The prepared vector of endogenous variables. |
z |
The prepared matrix of regressors. |
omega_i |
The prepared diagonal matrix of measurement error variances. |
All matrices are returned as sparse matrices.
Chan, J., Koop, G., Poirier, D. J., & Tobias J. L. (2019). Bayesian econometric methods (2nd ed.). Cambridge: Cambridge University Press.
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")}
# Create artificial data
k <- 3
tt <- 4
u <- matrix(1:(k * tt))
omega_i <- Matrix(diag(1:3, k))
# Generate input data (constant parameters)
covar_prepare_data(u, omega_i, k, tt, FALSE)
# Generate input data (time varying parameters)
covar_prepare_data(u, omega_i, k, tt, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.