coda.list.mcmc {bayesTFR}R Documentation

Convertion to coda's Objects

Description

The functions convert MCMC traces (simulated using run.tfr.mcmc and run.tfr3.mcmc) into objects that can be used with the coda package.

Usage

coda.list.mcmc(mcmc = NULL, country = NULL, chain.ids = NULL, 
    sim.dir = file.path(getwd(), "bayesTFR.output"), 
    par.names = tfr.parameter.names(), 
    par.names.cs = tfr.parameter.names.cs(), 
    rm.const.pars = FALSE, burnin = 0, 
    low.memory = FALSE, ...)
    
coda.list.mcmc3(mcmc = NULL, country = NULL, chain.ids = NULL, 
    sim.dir = file.path(getwd(), "bayesTFR.output"), 
    par.names = tfr3.parameter.names(), 
    par.names.cs = tfr3.parameter.names.cs(), 
    burnin = 0, low.memory = FALSE, ...)
	
## S3 method for class 'bayesTFR.mcmc'
coda.mcmc(mcmc, country = NULL, 
    par.names = NULL, par.names.cs = NULL, 
    burnin = 0, thin = 1, ...)

Arguments

mcmc

In coda.mcmc, it is an object of class bayesTFR.mcmc. In coda.list.mcmc and coda.list.mcmc3, it is either a list of bayesTFR.mcmc objects, or an object of class bayesTFR.mcmc.set or in case of coda.list.mcmc it can be bayesTFR.prediction. If it is NULL, the MCMCs are loaded from sim.dir. Either mcmc or sim.dir must be given.

country

Country name or code. It is used in connection with the par.names.cs argument (see below).

chain.ids

Vector of chain identifiers. By default, all chains available in the mcmc.list object are included.

sim.dir

Directory with the MCMC simulation results. Only used if mcmc.list is NULL.

par.names

Names of country-independent parameters to be included. In coda.mcmc the default names are tfr.parameter.names() if the mcmc object is an MCMC of phase II or tfr3.parameter.names() if the MCMC is of phase III.

par.names.cs

Names of country-specific parameters to be included. The argument country is used to filter out traces that correspond to a specific country. If country is not given, for each parameter, traces for all countries are included. In coda.mcmc the default names are tfr.parameter.names.cs() if the mcmc object is an MCMC of phase II or tfr3.parameter.names.cs() if the MCMC is of phase III.

rm.const.pars

Logical indicating if parameters with constant values should be removed.

burnin

Burnin indicating how many iterations should be removed from the beginning of each chain.

low.memory

Logical indicating if the function should run in a memory-efficient mode.

thin

Thinning interval.

...

Additional arguments passed to the coda's mcmc function.

Details

Function coda.list.mcmc is for accessing all chains of phase II MCMCs; Function coda.list.mcmc3 is for accessing all chains of phase III MCMCs.

Value

The function coda.list.mcmc and coda.list.mcmc3 return an object of class “mcmc.list”. The function coda.mcmc returns an object of class “mcmc”, both defined in the coda package.

Author(s)

Hana Sevcikova


[Package bayesTFR version 7.4-2 Index]