| metrics {compareMCMCs} | R Documentation |
Built-in metrics for MCMCresult objects
Description
These functions are normally called via compareMCMCs or addMetric.
Usage
MCMCmetric_mean(result, ...)
MCMCmetric_median(result, ...)
MCMCmetric_sd(result, ...)
MCMCmetric_CI95(result, ...)
MCMCmetric_CI95low(result, ...)
MCMCmetric_CI95upp(result, ...)
MCMCmetric_ESS(result, options = NULL)
MCMCmetric_efficiency(result, options = NULL)
Arguments
result |
An MCMCresult object, normally a list element
returned by |
... |
Possible additional arguments to metric functions. |
options |
A (metric-specific) list of named control options accepted by some metrics. |
Details
A metric is a summary of MCMC output. The summary may include results for each parameter, for each MCMC sample (across all parameters), and/or by arbitrary list. The last option is not used by any built-in metrics.
The built-in metrics include:
mean : mean for each parameter
median : median for each parameter
sd : standard deviation for each parameter
CI95 : both ends of 95% credible interval, a combination of CI95low and CI95upp
CI95low : lower end of 95% credible interval
CI95upp : upper end of 95% credible interval
ESS : effective sample size (ESS). Control options include
ESSfun(a function to estimate ESS, with default =coda::effectiveSize), andsuffix(a character string to be appended to "ESS" to form a label, with default = "").efficiency or (synonomously) efficiency_coda : effective sample size (ESS) and efficiency (ESS / computation time). If
ESSwas already calculated, it will not be re-calculated. Control options includeESSfun(passed toESS),suffix(a character string to be appended to "efficiency" to form a label, with default = ""), andtime(a character string to be used as an expression to calculate the computation time from elements of thetimeselement of theresultobject, with default = "sampling" for burning+postburnin times).
Value
A list that may contain elements named:
-
byParameter: A named list of vectors. In each vector, the elements correspond to parameters. The list names will become parameter names in thebyParameterelement ofmetricselements inMCMCresultobjects. -
byMCMC: A named list of numbers.
It is also valid to return a list of such lists.
In normal use, metrics are called by addMetrics (possibly from
compareMCMCs) and the results are collated in the metrics field
of MCMCresult objects.