bayesLife.mcmc {bayesLife}R Documentation

MCMC Simulation Object

Description

MCMC simulation object bayesLife.mcmc containing information about one MCMC chain. A set of such objects belonging to the same simulation together with a bayesLife.mcmc.meta object constitute a bayesLife.mcmc.set object.

Details

An object bayesLife.mcmc points to a place on disk (element output.dir) where MCMC results from all iterations are stored. They can be retrieved to the memory using get.e0.mcmc(...).

The object is in standard cases not to be manipulated by itself, but rather as part of a bayesLife.mcmc.set object.

Value

A bayesLife.mcmc object contains parameters of the Bayesian hierarchical model, more specifically, their initial values (all names with the suffix .ini) and values from the last iteration. These are:
Triangle/Triangle.ini, lambda/lambda.ini - world parameters, containing four values each. They correspond to model parameters Δ1,,Δ4\Delta_1, \dots, \Delta_4 and λ1,λ4\lambda_1, \dots \lambda_4, respectively.
k/k.ini, z/z.ini, omega/omega.ini, lambda.k/lambda.k.ini,
lambda.z/lambda.z.ini - world parameters, containing one value each. They correspond to model parameters kk, zz, ω\omega, λk\lambda_k, and λz\lambda_z, respectively.
Triangle.c - country-specific parameter Δ1c,,Δ4c\Delta^c_1, \dots, \Delta^c_4 with four values for each country, i.e. an 4×C4 \times C matrix where CC is the number of countries.
k.c, z.c - country-specific parameters kck^c and zcz^c (1d arrays of length CC).
Furthermore, the object contains components:

iter

Total number of iterations the simulation was started with.

finished.iter

Number of iterations that were finished. Results from the last finished iteration are stored in the parameters above.

length

Length of the MCMC stored on disk. It differs from finished.iter only if thin is larger than one.

thin

Thinning interval used when simulating the MCMCs.

id

Identifier of this chain.

output.dir

Subdirectory (relative to output.dir in the bayesLife.mcmc.meta object) where results of this chain are stored.

traces

This is a placeholder for keeping whole parameter traces in the memory. If the processing operates in a low memory mode, it will be 0. It can be filled in using the function get.e0.mcmc(..., low.memory=FALSE). In such a case, traces is a I×JI \times J array where II is the MCMC length and JJ is the number of parameters.

traces.burnin

Burnin used to retrieve the traces, i.e. how many stored iterations are missing from the beginning in the traces array comparing to the ‘raw’ traces on the disk.

rng.state

State of the random number generator at the end of the last finished interation.

meta

Object of class bayesLife.mcmc.meta used for simulation of this chain.

Author(s)

Hana Sevcikova

See Also

run.e0.mcmc, get.e0.mcmc, bayesLife.mcmc.set, bayesLife.mcmc.meta

Examples

sim.dir <- file.path(find.package("bayesLife"), "ex-data", "bayesLife.output")
# loads traces from one chain
m <- get.e0.mcmc(sim.dir, low.memory = FALSE, burnin = 40, chain.ids = 1)
# should have 20 rows, since 60 iterations in total minus 40 burnin
dim(e0.mcmc(m, 1)$traces)
summary(m)

[Package bayesLife version 5.2-0 Index]