mig.coda.list.mcmc {bayesMig}R Documentation

Conversion to coda-formatted objects

Description

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

Usage

mig.coda.list.mcmc(
  mcmc.list = NULL,
  country = NULL,
  chain.ids = NULL,
  sim.dir = NULL,
  par.names = NULL,
  par.names.cs = NULL,
  low.memory = FALSE,
  ...
)

Arguments

mcmc.list

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

country

Location name or code. 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. Default names are those returned by the mig.parameter.names function, which includes all country-independent parameters in the BHM.

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 location. If country is not given, traces of each parameter are given for all countries. Default names are those returned by mig.parameter.names.cs(), which includes all country-specific parameters in the BHM.

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

Returns an object of class mcmc.list defined in the coda package.


[Package bayesMig version 0.4-6 Index]