Learn R Programming

ergm (version 3.8.0)

colMeans.mcmc.list: utility operations for mcmc.list objects

Description

Adaptations of colMeans and sweep for working with mcmc.list objects. The function mcmc.list is used to represent parallel runs of the same chain, with different starting values and random seeds.

Usage

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

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

Arguments

x

a mcmc.list object

STATS

the summary statistic which is to be swept out

FUN

the function to be used to carry out the sweep (default is '-', subtraction)

check.margin

logical. If TRUE (the default), warn if the length or dimensions of STATS do not match the specified dimensions of x. Set to FALSE for a small speed gain when you know that dimensions match.

additional arguments to colMeans or sweep

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.lists returns an appropriately modified version of x

Details

colMeans.mcmc.list converts the mcmc list into a matrix and then runs colMeans on it

sweep.mcmc.lists modifies the values of the chains by computing some aggregate summary statistic function (STATS) on the entire chain and applying it to each value via FUN (default is subtraction). See sweep for additional examples.