plot-DLcurve: Plotting Posterior Distribution of the Double Logistic...

Description Usage Arguments Details Author(s) Examples

Description

The functions plot the posterior distribution of the double logistic function used in the simulation of Phase II, including their median and given probability intervals.

Usage

1
2
3
4
5
6
7
8
DLcurve.plot(mcmc.list, country, burnin = NULL, pi = 80, tfr.max = 10, 
    nr.curves = NULL, predictive.distr = FALSE, ylim = NULL, 
    xlab = 'TFR (reversed)', ylab = 'TFR decrement', main = NULL, 
    show.legend = TRUE, col=c('black', 'red', "#00000020"), ...)
	
DLcurve.plot.all(mcmc.list = NULL, sim.dir = NULL, 
    output.dir = file.path(getwd(), 'DLcurves'),
    output.type = "png", burnin = NULL, verbose = FALSE, ...)

Arguments

mcmc.list

List of bayesTFR.mcmc objects, an object of class bayesTFR.mcmc.set or of class bayesTFR.prediction. In case of DLcurve.plot.all if it si NULL, it is loaded from sim.dir.

country

Name or numerical code of a country.

burnin

Number of iterations to be discarded from the beginning of parameter traces.

pi

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

tfr.max

Maximum TFR to be shown in the plot.

nr.curves

Number of curves to be plotted. If NULL, all curves are plotted.

predictive.distr

Logical. If TRUE, an error term is added to each trajectory.

ylim, xlab, ylab, main

Graphical parameters passed to the plot function.

show.legend

Logical determining if the legend should be shown.

col

Vector of colors in this order: 1. observed data points, 2. quantiles, 3. trajectories

...

Additional graphical parameters. For DLcurve.plot.all, ... contains also arguments pi, tfr.max and nr.curves.

sim.dir

Directory with the simulation results. Only relevant, if mcmc.list is NULL.

output.dir

Directory into which resulting graphs are stored.

output.type

Type of the resulting files. It can be “png”, “pdf”, “jpeg”, “bmp”, “tiff”, or “postscript”.

verbose

Logical switching log messages on and off.

Details

DLcurve.plot plots double logistic curves for the given country. DLcurve.plot.all creates such plots for all countries and stores them in output.dir. Parameters inputting the double logistic function are either thinned traces created by the tfr.predict function (if mcmc.list is an object of class bayesTFR.prediction), or they are selected by equal spacing from the MCMC traces. In the former case, burnin is set automatically; in the latter case, burnin defaults to 0. If nr.curves is smaller than 2000, the median and probability intervals are computed on a sample of 2000 equally spaced data points, otherwise on all plotted curves.

Author(s)

Hana Sevcikova, Leontine Alkema

Examples

1
2
3
4
5
6
## Not run: 
sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
mcmc.set <- get.tfr.mcmc(sim.dir=sim.dir)
DLcurve.plot(country="Burkina Faso", mcmc.set, burnin=15)

## End(Not run)

jasonacollins/bayesTFR1 documentation built on May 23, 2019, 7:34 a.m.