View source: R/plot_diagnostics.R
| diagnostic_summary | R Documentation |
Provides a comprehensive diagnostic report for a tulpa model, combining convergence metrics, divergence information, and actionable recommendations.
diagnostic_summary(fit, quiet = FALSE)
## S3 method for class 'tulpa_diagnostic_summary'
print(x, ...)
fit |
A |
quiet |
Logical; if TRUE, suppress printed output (default: FALSE). |
x |
A |
... |
Ignored. |
A list with class tulpa_diagnostic_summary containing:
Overall status: "PASS", "WARN", or "FAIL"
Number of divergent transitions
Percentage of divergent transitions
Data frame of parameters with worst Rhat
Data frame of parameters with worst ESS
E-BFMI value (HMC only)
approximation fits only: the outer PSIS k-hat, or the grid quadrature ESS when no k-hat was produced
approximation fits only: the range
over coefficients of the share of the fixed-effect marginal variance the
hyperparameter integration contributed, between / (within + between)
under the law of total variance over the outer grid. Near zero means the
reported interval is what conditioning on a single hyperparameter point
would have given. Reported without a threshold and never scored: a small
share is not by itself a miscalibrated interval. NA when the fit
retains no per-cell pieces to decompose
approximation fits only, and only when there is no
k-hat: WHY – "not_requested" and
"unguessable_axis: <axis>" are benign or permanent,
"degenerate_proposal" and "grid_too_small" are signals about the fit,
and "internal_inconsistency" is an engine bug and raises the status to
"WARN"
approximation fits only: the
largest scored inner-Laplace |gamma_3|, or why nothing was scored
("coupled_arm" marks arms the inner layer could
score neither per observation nor through the cell tensor)
data frame of grid axes the fit's own resolved path could not read and dropped as engine defaults: one row per field, with the block, family, path and the axis that path integrated instead. Absent whenever every supplied axis was used
Character vector of recommendations
check_diagnostics(), diagnostics(), plot_diagnostics()
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))
ds <- diagnostic_summary(fit)
print(ds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.