| bayes_dsge_var_mh | R Documentation |
Estimates the structural DSGE parameters, shock standard deviations
and the DSGE-prior weight \lambda jointly by random-walk
Metropolis-Hastings. The VAR coefficients are analytically
marginalised out at every iteration via the Normal-inverse-Wishart
conjugate posterior, so only (\theta_{\text{DSGE}}, \sigma,
\lambda) are explicitly sampled.
bayes_dsge_var_mh(
model,
data,
priors,
lambda_prior = NULL,
p = 4L,
chains = 2L,
iter = 5000L,
warmup = NULL,
thin = 1L,
proposal_scale = 0.1,
include_intercept = TRUE,
seed = NULL
)
model |
A |
data |
Matrix or data frame of observable variables. Column names
must match a subset of |
priors |
Named list of |
lambda_prior |
A |
p |
Integer. VAR lag order. Default 4. |
chains |
Integer. Number of MH chains. Default 2. |
iter |
Integer. Total iterations per chain (warmup + sampling). Default 5000. |
warmup |
Integer. Warmup iterations. Default |
thin |
Integer. Thinning interval. Default 1. |
proposal_scale |
Numeric. Initial RW proposal scale. Default 0.1. |
include_intercept |
Logical. Include a constant term in the VAR.
Default |
seed |
Optional integer seed. |
The likelihood kernel is the DSGE-VAR closed-form log marginal likelihood (Del Negro & Schorfheide 2004, eqs. 19–21):
\log p(Y\mid\theta,\lambda) =
-\frac{T n_y}{2}\log\pi
+ \frac{n_y}{2}\log\big|\lambda T\,\Gamma_{XX}(\theta)\big|
- \frac{n_y}{2}\log|\bar M_{XX}|
+ \frac{\lambda T}{2}\log\big|\lambda T\,\Gamma_{YY\mid X}(\theta)\big|
- \frac{\bar T}{2}\log|\bar S|
+ \log\Gamma_{n_y}(\bar T/2) - \log\Gamma_{n_y}(\lambda T/2).
This is added to log priors on the structural parameters, shock
standard deviations and \lambda to form the log-posterior.
The sampler is the same adaptive random-walk Metropolis-Hastings used
by bayes_dsge; it operates in unconstrained parameter
space with appropriate Jacobian corrections (log for positive
parameters, logit for bounded parameters).
An object of class "dsge_dsgevar_mh" containing:
Array (iter-warmup) x n_params x chains of posterior
draws (in natural parameter space). Last column is lambda.
Names of all sampled parameters.
Per-chain MH acceptance rate.
Posterior mean of \lambda.
2.5\
of \lambda.
Inputs needed by downstream
methods such as forecast.dsge_dsgevar_mh.
Names of free DSGE structural parameters.
Names of shocks whose SDs are estimated.
MH settings.
Del Negro, M. and Schorfheide, F. (2004). Priors from general equilibrium models for VARs. International Economic Review, 45(2), 643-673.
bayes_dsge_var for VAR estimation with a fixed
DSGE solution; forecast.dsge_dsgevar_mh and
conditional_forecast.dsge_dsgevar_mh for forecasts
integrating over the joint posterior.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.