Learn R Programming

bayesTFR (version 4.2-0)

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

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

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, ...)
	
DLcurve.plot.all(mcmc.list = NULL, sim.dir = NULL, 
    output.dir = file.path(getwd(), 'DLcurves'),
    output.type = "png", burnin = NULL, verbose = FALSE, ...)

Arguments

Rdversion

1.1

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab