prior_posterior_update: Prior-Posterior Update Diagnostics

View source: R/prior-posterior.R

prior_posterior_updateR Documentation

Prior-Posterior Update Diagnostics

Description

Computes diagnostics measuring how informative the data was for each parameter, by comparing the posterior distribution to the prior.

Usage

prior_posterior_update(x, ...)

## S3 method for class 'dsge_bayes'
prior_posterior_update(x, ...)

Arguments

x

A dsge_bayes object.

...

Additional arguments (currently unused).

Details

For each estimated parameter, the following diagnostics are computed:

sd_ratio

Ratio of posterior SD to prior SD. Values near 1 indicate the data was uninformative (posterior tracks the prior). Values much less than 1 indicate strong data information.

mean_shift

Absolute difference between posterior mean and prior mean, measured in units of prior SD. Large shifts indicate the data substantially updated beliefs.

update

Classification: "strong" if sd_ratio < 0.5 or mean_shift > 2; "moderate" if sd_ratio < 0.8 or mean_shift > 1; "weak" otherwise (posterior closely resembles the prior).

The SD ratio is the primary indicator of data informativeness. A parameter with sd_ratio close to 1 and small mean_shift is effectively determined by the prior, not the data.

Value

An object of class "dsge_prior_posterior" containing:

summary

Data frame with per-parameter diagnostics including prior mean/sd, posterior mean/sd, SD ratio, mean shift, and update classification.

param_names

Character vector of parameter names.

Examples


m <- dsge_model(
  obs(y ~ z),
  state(z ~ rho * z),
  start = list(rho = 0.5)
)
set.seed(1)
z <- numeric(100); for (i in 2:100) z[i] <- 0.8*z[i-1]+rnorm(1)
fit <- bayes_dsge(m, data = data.frame(y = z),
  priors = list(rho = prior("beta", shape1 = 2, shape2 = 2)),
  chains = 2, iter = 2000, seed = 1)
pp <- prior_posterior_update(fit)
print(pp)



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