post_summ | R Documentation |
Allows rapid calculation of summaries and diagnostics from specific nodes
stored in mcmc.list
objects.
post_summ( post, params, digits = NULL, probs = c(0.5, 0.025, 0.975), Rhat = FALSE, neff = FALSE, mcse = FALSE, by_chain = FALSE, auto_escape = TRUE )
post |
A |
params |
A vector of regular expressions specifying the nodes to match for summarization.
Accepts multi-element vectors to match more than one node at a time.
See |
digits |
Control rounding of summaries.
Passed to |
probs |
Posterior quantiles to calculate. Passed to |
Rhat |
Calculate the Rhat convergence diagnostic using |
neff |
Calculate the number of effective MCMC samples using |
mcse |
Calculate the Monte Carlo standard error for the posterior mean and reported quantiles
using the |
by_chain |
Calculate posterior summaries for each chain
rather than for the aggregate across chains? Defaults to |
auto_escape |
Automatically escape |
A matrix
object with summary statistics as rows and nodes as columns.
If by_chain = TRUE
, an array
with chain-specific summaries as the third dimension is returned instead.
match_params()
, coda::gelman.diag()
, coda::effectiveSize()
, mcmcse::mcse()
, mcmcse::mcse.q()
# load example mcmc.list data(cjs) # calculate posterior summaries for the "p" nodes # ("p[1]" doesn't exist in model) post_summ(cjs, "p") # do this by chain post_summ(cjs, "p", by_chain = TRUE) # calculate Rhat and Neff diagnostic summaries as well # multiple node names too post_summ(cjs, c("b0", "p"), Rhat = TRUE, neff = TRUE) # calculate Monte Carlo SE for mean and quantiles, with rounding post_summ(cjs, "p", mcse = TRUE, digits = 3) # summarize different quantiles: median and central 80% post_summ(cjs, "p", probs = c(0.5, 0.1, 0.9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.