View source: R/prior-posterior.R
| prior_posterior_update | R Documentation |
Computes diagnostics measuring how informative the data was for each parameter, by comparing the posterior distribution to the prior.
prior_posterior_update(x, ...)
## S3 method for class 'dsge_bayes'
prior_posterior_update(x, ...)
x |
A |
... |
Additional arguments (currently unused). |
For each estimated parameter, the following diagnostics are computed:
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.
Absolute difference between posterior mean and prior mean, measured in units of prior SD. Large shifts indicate the data substantially updated beliefs.
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.
An object of class "dsge_prior_posterior" containing:
Data frame with per-parameter diagnostics including prior mean/sd, posterior mean/sd, SD ratio, mean shift, and update classification.
Character vector of parameter names.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.