Learn R Programming

bayesTFR (version 1.4-0)

bayesTFR.mcmc: MCMC Simulation Object

Description

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

Arguments

Value

A bayesTFR.mcmc object contains parameters of the Bayesian hierarchical model, more specifically, their values from the last iteration. These 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. Furthermore, the object contains components:iterTotal number of iterations the simulation was started with.finished.iterNumber of iterations that were finished. Results from the last finished iteration are stored in the parameters above.lengthLength of the MCMC stored on disk. It differs from finished.iter only if thin is larger than one.thinThinning interval used when simulating the MCMCs.idIdentifier of this chain.output.dirSubdirectory (relative to output.dir in the bayesTFR.mcmc.meta object) where results of this chain are stored.tracesThis 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.burninBurnin 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.stateState of the random number generator at the end of the last finished interation.metaObject of class bayesTFR.mcmc.meta used for simulation of this chain.

Rdversion

1.1

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(...) 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.

See Also

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

Examples

Run this code
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=25, chain.ids=1)
# should have 25 rows, since 50 iterations in total minus 25 burnin
dim(tfr.mcmc(m, 1)$traces)
summary(m, chain.id=1)

Run the code above in your browser using DataLab