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.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:finished.iter only if thin is larger than one.output.dir in the bayesTFR.mcmc.meta object) where results of this chain are stored.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 array comparing to the bayesTFR.mcmc.meta used for simulation of this chain.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.
run.tfr.mcmc, get.tfr.mcmc, run.tfr3.mcmc, get.tfr3.mcmc, bayesTFR.mcmc.set, bayesTFR.mcmc.metasim.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)Run the code above in your browser using DataLab