method_summary: Print and summary methods for objects of class 'mcmcOutput'

summary.mcmcOutputR Documentation

Print and summary methods for objects of class mcmcOutput

Description

summary generates a data frame with summary and diagnostic statistics for each of the MCMC chains in the mcmcOutput object, and (if verbose = TRUE) prints a brief overview to the Console. The data frame will be displayed in the Console unless assigned to an object or passed to View.

sumryList generates summary and diagnostic statistics for each of the MCMC chains in the mcmcOutput object and returns them as a list-of-lists, see Value.

summary and sumryList now have a CRItype="none" option and arguments to include overlap0 and f in the summary table.

print displays characteristics of the mcmcOutput object. It does not display summaries of the values: for that use summary.

Usage

## S3 method for class 'mcmcOutput'
summary(object, digits=3, median=TRUE, mode=FALSE,
    CRItype=c("hdi", "symmetrical", "none"),
    CRImass=0.95, Rhat=TRUE, MCEpc = TRUE, n.eff=FALSE,
    overlap0=FALSE, f=FALSE, verbose=TRUE, ...)

## S3 method for class 'mcmcOutput'
print(x, ...)

sumryList(object, median=TRUE, mode=FALSE,
    CRItype=c("hdi", "symmetrical", "none"),
    CRImass=0.95, Rhat=TRUE, MCEpc = TRUE, n.eff=FALSE,
    overlap0=FALSE, f=FALSE, ...)

Arguments

x, object

an object of class mcmcOutput.

digits

the number of digits for rounding of values in the output.

median

if TRUE, the median will be included as a column in the data frame produced.

mode

if TRUE, the mode will be included as a column in the data frame produced.

CRItype

if hdi, the credible interval will be a highest density interval; if symmetrical, a symmetrical CRI will be generated with quantile; ignored if CRImass=NA.

CRImass

the probability mass to include in the credible interval; if CRImass=NA, no CRI will be included in the output.

Rhat

if TRUE, estimates of Rhat will be included; ignored if only 1 chain or < 100 values per chain. See getRhat.

MCEpc

if TRUE, estimates of the Monte Carlo standard error as a percentage of the posterior SD will be included; ignored if < 100 values per chain. See getMCE.

n.eff

if TRUE, estimates of the effective number of draws allowing for autocorrelation will be included; ignored if < 100 values per chain. See getNeff.

overlap0

if TRUE, a column with TRUE/FALSE will be included, indicating whether the credible interval includes zero. Ignored if no CRI is calculated.

f

if TRUE, a column with the proportion of the posterior with the same sign as the mean.

verbose

if FALSE, suppresses output to the Console, other than the table of statistics.

...

further arguments for the print or summary function.

Value

print returns x invisibly.

summary returns a data frame with columns for summary and diagnostic statistics and a row for each node; mean and SD are always included, other columns if selected. It has attributes for nChains and simsList derived from the input object. The output will appear in the Console unless assigned to an object or passed to View.

sumryList returns a list with a component for each statistic; each component is itself a list with the values for each parameter. See examples.

Author(s)

Mike Meredith.

Examples

data(mcmcListExample)
mco <- mcmcOutput(mcmcListExample)
mco  # equivalent to ...
print(mco)
summary(mco)
# just the summary data frame
summary(mco, verbose=FALSE)
# assign the output to an object
tmp <- summary(mco, median=FALSE, CRItype="sym", CRImass=0.8,
    n.eff=TRUE, MCEpc=FALSE)
tmp

mcos <- sumryList(mco)
str(mcos)
mcos$mean$p
mcos$MCEpc$z

mcmcOutput documentation built on Nov. 18, 2022, 1:08 a.m.