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.code = NULL, ISO.code = NULL, 
    sim.dir = NULL, burnin = 0, thin = 1, pis = c(80, 95), plot.raw = TRUE, 
    grouping = "source", save.image = TRUE, plot.dir = "Estimation.plot")

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.code

Name or numerical code of a country. If it is NULL, ISO.code needs to be provided.

ISO.code

Country code as ISO-3 character. Only used if country.code is NULL.

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.

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.0-4 Index]