| rhat_summary | R Documentation |
Extract R-hat values from a fitted MCMC object as a numeric vector.
The returned object prints a compact convergence summary and can be passed
directly to functions such as hist.
rhat_summary(fit, ...)
## Default S3 method:
rhat_summary(fit, ...)
## S3 method for class 'mcmc_fit'
rhat_summary(
fit,
pars = NULL,
chains = NULL,
best_chains = NULL,
inc_random = FALSE,
inc_transform = TRUE,
inc_generate = FALSE,
finite = TRUE,
...
)
fit |
A fitted model object. |
... |
Additional arguments passed to methods. |
pars |
Character or numeric vector specifying parameters to include.
If |
chains |
Numeric vector specifying chains to include. |
best_chains |
Integer; number of best chains to retain based on mean log-posterior. |
inc_random |
Logical; whether to include random effects. Default is |
inc_transform |
Logical; whether to include transformed parameters. Default is |
inc_generate |
Logical; whether to include generated quantities. Default is |
finite |
Logical; whether to drop non-finite or missing R-hat values. Default is |
A numeric vector of R-hat values with class "rhat_summary".
data(debate, package = "BayesRTMB")
mdl <- rtmb_lm(sat ~ talk + perf, data = debate)
fit <- mdl$sample(sampling = 200, warmup = 200, chains = 2)
r <- rhat_summary(fit)
r
hist(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.