Learn R Programming

bayesTFR (version 1.0-0)

tfr.raftery.diag: Raftery Diagnostics for Parameters of the Total Fertility Rate

Description

The function computes the Raftery diagnostics for each parameter, averaged over chains. For country-specific parameters, 95%-quantile over all countries is taken.

Usage

tfr.raftery.diag(mcmc = NULL, 
    sim.dir = file.path(getwd(), "bayesTFR.output"), 
    burnin = 0, country = NULL,
    par.names = tfr.parameter.names(trans = TRUE), 
    par.names.cs = tfr.parameter.names.cs(trans=TRUE),
    country.sampling.prop = 1, verbose=TRUE, ...)

Arguments

Value

List with the components:N2-d array of $N$ values (processed as described in Details) with two columns: first corresponding to q=0.025, second corresponding to q=0.975. Each row corresponds to one parameter.burnin2-d array of the same structure as N, containing the burnin values (processed as described in Details).not.converged.parametersList with two elements, each of which is a data frame containing columns parameter.name, chain.id, and N. These are parameters for which the computed value of Raftery diagnostics $N$ is larger than the total number of finished iterations summed over all chains. The first element of the list corresponds to q=0.025, second corresponds to q=0.975.not.converged.inchain.parametersList of the same structure as not.converged.parameters. The parameters included are those for which the computed value of Raftery diagnostics $N$ is larger than the number of finished iterations in the corresponding chain.N.country.indepData frame containing columns parameter.name, chain.id, N0.025, and N0.975. Each row gives $N$ computed with the two different $q$ for each country-independent parameter and chain.N.country.specThe same as N.country.indep, but here the country-specific parameters are considered.Navg.country.spec2-d array of $N$ values for country-specific parameters containing averages over chains.nr.countriesVector with elements used (number of countries used in this diagnostics) and total (number of countries that this mcmc object was estimated on).

Rdversion

1.1

Details

The Raftery diagnostics is computed for each parameter, using coda's raftery.diag with r=0.0125, q=0.025 and q=0.975. Values of $N$ and burnin are averaged over chains. For each country-specific parameter, the 95%-quantile over all included countries of such averaged values is taken.