Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mcmc-utilities

Utility operations for mcmc.list objects


Description

colMeans.mcmc.list is a "method" for (non-generic) colMeans applicable to mcmc.list objects.

sweep.mcmc.list is a "method" for (non-generic) sweep applicable to mcmc.list objects.

lapply.mcmc.list is a "method" for (non-generic) lapply applicable to mcmc.list objects.

Usage

colMeans.mcmc.list(x, ...)

sweep.mcmc.list(x, STATS, FUN = "-", check.margin = TRUE, ...)

lapply.mcmc.list(X, FUN, ...)

Arguments

x

a mcmc.list object.

...

additional arguments to colMeans or sweep.

STATS, FUN, check.margin

See help for sweep.

X

An mcmc.list object.

Value

colMeans.mcmc returns a vector with length equal to the number of mcmc chains in x with the mean value for each chain.

sweep.mcmc.list returns an appropriately modified version of x

lapply.mcmc.list returns an mcmc.list each of whose chains had been passed through FUN.

See Also

Examples

data(line, package="coda")
summary(line) # coda
colMeans.mcmc.list(line) # "Method"

data(line, package="coda")
colMeans.mcmc.list(line)-1:3
colMeans.mcmc.list(sweep.mcmc.list(line, 1:3))

data(line, package="coda")
colMeans.mcmc.list(line)[c(2,3,1)]
colMeans.mcmc.list(lapply.mcmc.list(line, `[`,,c(2,3,1)))

statnet.common

Common R Scripts and Utilities Used by the Statnet Project Software

v4.4.1
GPL-3 + file LICENSE
Authors
Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Skye Bender-deMoll [ctb]
Initial release
2020-10-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.