tfr.estimation.plot {bayesTFR}R Documentation

Plot TFR Estimation

Description

Plot past TFR estimation results from a simulation that accounted for past TFR uncertainty.

Usage

tfr.estimation.plot(mcmc.list = NULL, country = NULL, sim.dir = NULL, 
    burnin = 0, thin = 1, pis = c(80, 95), plot.raw = TRUE, 
    grouping = "source", save.image = TRUE, plot.dir = "Estimation.plot", 
    adjust = TRUE, country.code = deprecated(), ISO.code = deprecated())

Arguments

mcmc.list

Object of class bayesTFR.mcmc.set corresponding Phase II MCMCs. If it is NULL, the object is loaded from the directory given by sim.dir.

country

Name or numerical code of a country. It can also be given as ISO-2 or ISO-3 characters.

sim.dir

Directory with the MCMC simulation results.

burnin

Burn-in for getting trajectories and quantiles. A positive burn-in x will remove first x iterations from each chain.

thin

Thin for getting trajectories and quantiles. Thinning level x greater than 1 will store one iteration per x samples

pis

Probability interval. It can be a single number or an array of two numbers.

plot.raw

Whether raw data used for the estimation should be plotted.

grouping

If raw data is plotted, then grouping should be one of the categorical feature in the data, so that the color and shape of the raw data will differ for different groups.

save.image

Logical. Whether the resulting plot will be saved.

plot.dir

If save.image=TRUE, specify the directory for saving the plot.

adjust

Logical. By default, if the estimation median is adjusted using e.g. tfr.median.set.all, the function plots the adjusted median. If adjust=FALSE the original (non-adjusted) median is plotted.

country.code, ISO.code

Deprecated arguments. Use argument country instead.

Details

tfr.estimation.plot plots posterior distribution of past TFR estimations for a given country. It only works if uncertainty is considered in the MCMC process.

Author(s)

Peiran Liu, Hana Sevcikova

Examples

## Not run: 
sim.dir <- tempfile()
mcmc.set <- run.tfr.mcmc(nr.chains = 1, iter = 10, output.dir = sim.dir, 
    replace.output = TRUE, uncertainty = TRUE)
tfr.estimation.plot(mcmc.set, "Nigeria", save.image = FALSE)
unlink(sim.dir, recursive = TRUE)
## End(Not run)

[Package bayesTFR version 7.4-2 Index]