e0.coda.list.mcmc {bayesLife}R Documentation

Convertion to coda's Objects

Description

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

Usage

e0.coda.list.mcmc(mcmc.list = NULL, country = NULL, chain.ids = NULL, 
    sim.dir = file.path(getwd(), "bayesLife.output"), 
    par.names = NULL, par.names.cs = NULL, low.memory = FALSE, ...)
    
## S3 method for class 'bayesLife.mcmc'
coda.mcmc(mcmc, country = NULL, par.names = NULL, par.names.cs = NULL, ...)

Arguments

mcmc.list

List of bayesLife.mcmc objects, or an object of class bayesLife.mcmc.set or bayesLife.prediction. If it is NULL, the MCMCs are loaded from sim.dir. Either mcmc.list or sim.dir must be given.

mcmc

Object of class bayesLife.mcmc.

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.

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.

low.memory

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

...

Additional arguments passed to the coda's mcmc function, such as burnin and thin.

Value

The function e0.coda.list.mcmc returns 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

See Also

e0.partraces.plot for plotting the MCMC traces and summary.bayesLife.mcmc.set.

Examples

sim.dir <- file.path(find.package("bayesLife"), "ex-data", "bayesLife.output")
coda.list <- e0.coda.list.mcmc(sim.dir = sim.dir, country = "France", burnin = 30)
summary(coda.list)

[Package bayesLife version 5.0-1 Index]