View source: R/plot_diagnostics.R
| check_diagnostics | R Documentation |
Runs the core convergence diagnostics on a fit and reports whether Rhat,
bulk-ESS, and divergence thresholds are all met. A terse companion to
diagnostic_summary() for use in scripts and tests.
check_diagnostics(
fit,
rhat_threshold = 1.01,
ess_threshold = 400,
quiet = FALSE
)
fit |
A |
rhat_threshold |
Maximum acceptable Rhat (default 1.01). |
ess_threshold |
Minimum acceptable bulk-ESS (default 400). |
quiet |
Logical; if TRUE, suppress messages (default FALSE). |
Invisibly, TRUE if all checks pass, FALSE if any fail, or NA
for a non-chain (approximation) fit where Rhat/ESS do not apply.
diagnostic_summary(), diagnostics(), n_divergent()
set.seed(123)
df <- data.frame(x = rnorm(60))
df$y <- rpois(60, exp(0.5 + 0.3 * df$x))
fit <- tulpa(y ~ x, data = df, family = "poisson", mode = "hmc",
control = list(n_iter = 500L, warmup = 250L, n_chains = 2L,
seed = 1L))
check_diagnostics(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.