View source: R/endogenous-prior.R
| endogenous_prior | R Documentation |
Constructs an endogenous prior (Christiano, Trabandt & Walentin 2011) that penalises parameter draws whose model-implied second moments differ from user-specified empirical targets. The endogenous prior adds a multivariate-Gaussian log-density on the moment vector
\log p_{endog}(\theta) = -\frac{1}{2}\bigl(m(\theta) - m^*\bigr)^\top
V^{-1}\bigl(m(\theta) - m^*\bigr)
to the existing log-prior, where m(\theta) is the model-implied
moment vector and m^* the empirical target.
endogenous_prior(target, weight = NULL)
target |
Named numeric vector of target moments to match. Names
should look like |
weight |
Optional positive-definite weighting matrix
( |
Supported moment specifications via name conventions:
"sd_<var>": standard deviation of observable
<var>.
"ac1_<var>": lag-1 autocorrelation of observable
<var>.
"cor_<v1>_<v2>": contemporaneous correlation between
observables <v1> and <v2>.
The closure builds the model-implied moments from the unconditional state covariance (solved via the doubling Lyapunov algorithm) and the observation equation.
A list of class "dsge_endog_prior" containing:
targetThe supplied target moment vector.
weightThe precision matrix used.
moments_fnA closure that takes a
dsge_solution and returns the model-implied moment
vector (same names as target).
log_densityA closure that takes a
dsge_solution and returns the endogenous-prior log
density (a scalar; -Inf on failure).
Pass this object to bayes_dsge(..., endogenous_prior = ...).
Christiano, L.J., Trabandt, M. and Walentin, K. (2011). Introducing financial frictions and unemployment into a small open economy model. Journal of Economic Dynamics and Control, 35(12), 1999-2041.
# Empirical SD and AR(1) of inflation and the policy rate
tgt <- c(sd_p = 0.5, sd_r = 0.6, ac1_p = 0.85, ac1_r = 0.95)
ep <- endogenous_prior(tgt)
# Then in estimation:
# fit <- bayes_dsge(model, data, priors = ...,
# endogenous_prior = ep)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.