| MCMCpstr | R Documentation |
Extract summary information and posterior chains from MCMC output (specific function specified) for specific parameters of interest while preserving original parameter structure (i.e., scalar, vector, matrix, array). Function outputs a list with calculated values or posterior chains for each specified parameter.
MCMCpstr(
object,
params = "all",
excl = NULL,
ISB = TRUE,
exact = TRUE,
func = mean,
type = "summary"
)
object |
Object containing MCMC output. See DETAILS below. |
params |
Character string (or vector of character strings) denoting parameters to be returned in output. Default |
excl |
Character string (or vector of character strings) denoting parameters to exclude. Used in conjunction with |
ISB |
Ignore Square Brackets (ISB). Logical specifying whether square brackets should be ignored in the |
exact |
Logical specifying whether input from |
func |
Function to be performed on MCMC output. When output of specified function is greater than length 1, an extra dimension is added. For instance, output of length 3 for a parameter with dimensions 2x2 results in a 2x2x3 output. Functions that produce output with dimensionality greater than 1 are not permitted. |
type |
Character string specifying whether to return summary information (calculated based on |
object argument can be a stanfit object (rstan package), a CmdStanMCMC object (cmdstanr package), a stanreg object (rstanarm package), a brmsfit object (brms package), an mcmc.list object (coda and rjags packages), mcmc object (coda and nimble packages), list object (nimble package), an R2jags model object (R2jags package), a jagsUI model object (jagsUI package), or a matrix containing MCMC chains (each column representing MCMC output for a single parameter, rows representing iterations in the chain). The function automatically detects the object type and proceeds accordingly.
#Load data
data(MCMC_data)
MCMCpstr(MCMC_data, func = function(x) quantile(x, probs = c(0.01, 0.99)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.