chainSummary: Manipulate MCMC samples

View source: R/SGAT.R

chainSummaryR Documentation

Manipulate MCMC samples

Description

Manipulate the samples generated by the Metropolis samplers.

Usage

chainSummary(s)

chainTail(s, discard = 0, thin = 1)

chainLast(s)

chainCollapse(s, collapse = TRUE, discard = 0, thin = 1, chains = NULL)

chainCov(s, discard = 0, chains = NULL)

chainBcov(s, discard = 0, chains = NULL)

chainAcceptance(s, collapse = FALSE, chains = NULL)

Arguments

s

a single chain or a list of parallel chains generated by estelleMetropolis or stellaMetropolis.

discard

number of initial samples to discard.

thin

rate at which to thin the sample.

collapse

whether to collapse parallel chains to a single chain

chains

the set of chains to retain, or NULL.

Details

These functions provide some basic operations on the samples generated by the Metropolis samplers for Estelle and Stella.

Value

chainSummary returns a summary of the sample chainTail discards the initial samples from each chain chainLast returns the last sample for each location in each chain chainCollapse collapses multiple chains into a single sample chainCov returns the covariance of the parameters location by location as a pxpxn array. chainBcov returns the joint covariance of the parameters as an (np)x(np) array. chainAcceptance returns the acceptance rate in the (thinned) chain


SWotherspoon/SGAT documentation built on June 1, 2022, 10:49 p.m.