endogenous_prior: Endogenous Prior on Model-Implied Moments

View source: R/endogenous-prior.R

endogenous_priorR Documentation

Endogenous Prior on Model-Implied Moments

Description

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.

Usage

endogenous_prior(target, weight = NULL)

Arguments

target

Named numeric vector of target moments to match. Names should look like "sd_<var>" (standard deviation of an observable) or "ac1_<var>" (lag-1 autocorrelation). See Details.

weight

Optional positive-definite weighting matrix (V^{-1} above). If omitted, the inverse of diag(0.1^2 * target^2) is used (a 10\ moment).

Details

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.

Value

A list of class "dsge_endog_prior" containing:

target

The supplied target moment vector.

weight

The precision matrix used.

moments_fn

A closure that takes a dsge_solution and returns the model-implied moment vector (same names as target).

log_density

A 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 = ...).

References

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.

Examples


# 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)



dsge documentation built on Sept. 25, 2026, 5:08 p.m.