The functions convert MCMC traces (simulated using run.tfr.mcmc
and run.tfr3.mcmc
) into objects that can be used with the coda package.
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 bayesTFR.mcmc
coda.mcmc(mcmc, country = NULL,
par.names = NULL, par.names.cs = NULL,
burnin = 0, thin = 1, …)
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 name or code. It is used in connection with the par.names.cs
argument (see below).
Vector of chain identifiers. By default, all chains available in the mcmc.list
object are included.
Directory with the MCMC simulation results. Only used if mcmc.list
is NULL
.
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.
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.
Logical indicating if parameters with constant values should be removed.
Burnin indicating how many iterations should be removed from the beginning of each chain.
Logical indicating if the function should run in a memory-efficient mode.
Thinning interval.
Additional arguments passed to the coda's mcmc
function.
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.
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.