Learn R Programming

ArchaeoPhases (version 1.1)

coda.mcmc: Create a mcmc.list object for CODA users.

Description

This is a wrapper function that extracts parallel chains from the data given and coerces the output to a single mcmc.list object and diagnostic tools from "coda" can be used.

Usage

coda.mcmc(data, numberChains=1, iterationColumn=NULL)

Arguments

data

dataframe containing the output of the MCMC algorithm

numberChains

number of parallel chains. Default = 1.

iterationColumn

Column corresponding to the iteration values. Default = NULL

Value

A mcmc.list object.

Examples

Run this code
    data(Events)
    mcmcList = coda.mcmc(data = Events, numberChains = 3, iterationColumn=1) 
    plot(mcmcList)
    gelman.diag(mcmcList)
    # The multivariate criterion can not be evaluated when a phase 
    # contains only one date. This induces colinearity problems. 
    gelman.diag(mcmcList, multivariate=FALSE)

Run the code above in your browser using DataLab