bayesTFR.mcmc {bayesTFR}R Documentation

MCMC Simulation Object

Description

MCMC simulation object bayesTFR.mcmc containing information about one MCMC chain, either from Phase II or Phase III simulation. A set of such objects belonging to the same simulation together with a bayesTFR.mcmc.meta object constitute a bayesTFR.mcmc.set object.

Details

An object bayesTFR.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.tfr.mcmc(...) (Phase II) or get.tfr3.mcmc(...) (Phase III), and tfr.mcmc(...).

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

Value

A bayesTFR.mcmc object contains parameters of the Bayesian hierarchical model, more specifically, their values from the last iteration. If it is a Phase II object these parameters are:
psi, chi, a_sd, b_sd, const_sd, S_sd, sigma0, mean_eps_tau, sd_eps_tau, Triangle4 - non-country specific parameters, containing one value each.
alpha, delta - non-country specific parameters, containing three values each.
U_c, d_c, Triangle_c4 - country-specific parameters (1d array).
gamma_ci - country-specific parameter with three values for each country, i.e. an n \times 3 matrix where n is the number of countries.
Phase III MCMC objects contain single-value parameters mu, rho, sigma.mu, sigma.rho, sigma.eps and n-size vectors mu.c and rho.c.
Furthermore, the object (independent of Phase) 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 bayesTFR.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.tfr.mcmc(..., low.memory=FALSE). In such a case, traces is a I \times J array where I is the MCMC length and J 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.

compression.type

Type of compression of the underlying files.

meta

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

Author(s)

Hana Sevcikova

See Also

run.tfr.mcmc, get.tfr.mcmc, run.tfr3.mcmc, get.tfr3.mcmc, bayesTFR.mcmc.set, bayesTFR.mcmc.meta

Examples

## Not run: 
sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
# loads traces from one chain
m <- get.tfr.mcmc(sim.dir, low.memory=FALSE, burnin=35, chain.ids=1)
# should have 25 rows, since 60 iterations in total minus 35 burnin
dim(tfr.mcmc(m, 1)$traces)
summary(m, chain.id=1)
## End(Not run)

[Package bayesTFR version 7.4-2 Index]