Learn R Programming

bayesTFR (version 3.0-8)

tfr.diagnose: Convergence Diagnostics of TFR Markov Chain Monte Carlo

Description

Functions tfr.diagnose and tfr3.diagnose run convergence diagnostics of existing TFR MCMCs for phase II and phase III, respectively, using the raftery.diag function from the coda package. has.mcmc.converged checks if the existing diagnostics converged.

Usage

tfr.diagnose(sim.dir, thin = 80, burnin = 2000, express = FALSE, 
    country.sampling.prop = NULL, keep.thin.mcmc=FALSE, verbose = TRUE)
    
tfr3.diagnose(sim.dir, thin = 60, burnin = 10000, express = TRUE, 
    country.sampling.prop = NULL, verbose = TRUE, ...)
    
has.mcmc.converged(diag)

Arguments

Value

has.mcmc.converged returns a logical value determining if there is convergence or not. tfr.diagnose and tfr3.diagnose return an object of class bayesTFR.convergence with components:resultTable containing all not-converged parameters. Its columns include Total iterations needed and Remaining iterations.lresult.country.independentNumber of rows in result that correspond to country-independent paramters. These rows are groupped at the beginning of the table.country.independentResult of tfr.raftery.diag processed on country-independent parameters.country.specificResult of tfr.raftery.diag processed on country-specific parameters.iter.neededNumber of additional iterations suggested in order to achieve convergence.iter.totalTotal number of iterations of the original unthinned set of chains.use.nr.trajSuggestion for number of trajectories in generating predictions.burninBurnin used.thinThinning interval used.statusVector of character strings containing the result status. Possible values: green, red.mcmc.setObject of class bayesTFR.mcmc.set that corresponds to the original set of MCMCs on which the diagnostics was run.thin.mcmcIf keep.thin.mcmc is TRUE, it is an object of class bayesTFR.mcmc.set that corresponds to the thinned mcmc set on which the diagnostics was run, otherwise NULL.expressValue of the input argument express.nr.countriesVector with elements used - number of countries used in this diagnostics, and total - number of countries that this mcmc.set object was estimated on.

Rdversion

1.1

Details

The diagnose functions invoke the tfr.raftery.diag (or tfr3.raftery.diag) function separately for country-independent parameters and for country-specific parameters. It results in two possible states: red, i.e. it did not converge, and green, i.e. it converged. The resulting object from tfr.diagnose is stored in {sim.dir}/diagnostics/bayesTFR.convergence_{thin}_{burnin}.rda and can be accessed using the function get.tfr.convergence. Function tfr3.diagnose stores its result into {sim.dir}/phaseIII/diagnostics/bayesTFR.convergence_{thin}_{burnin}.rda which can be accessed via get.tfr3.convergence.

See Also

tfr.raftery.diag, raftery.diag, summary.bayesTFR.convergence, get.tfr.convergence, create.thinned.tfr.mcmc