get.tfr.estimation {bayesTFR}R Documentation

Get Past TFR Estimation

Description

Get past TFR estimation, including trajectories and quantiles if required.

Usage

get.tfr.estimation(mcmc.list = NULL, country.code = NULL, ISO.code = NULL, 
    sim.dir = NULL, burnin = 0, thin = 1, probs = NULL, adjust = TRUE)

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 as ISO-3 character.

ISO.code

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

sim.dir

Directory with the MCMC simulation results. Only used if mcmc.list is NULL.

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.

probs

A vector of numbers between [0,1] specifying which estimation quantiles should be outputted. If it is set to NULL no quantiles are returned.

adjust

Logical indicating whether the adjusted median and trajectories should be returned.

Details

This function is used to obtain the TFR estimation trajectories as well as corresponding quantiles if the mcmc.list has been obtained while taking account for uncertainty about the past, i.e. uncertainty=TRUE in run.tfr.mcmc. Quantiles are included in the results if probs is not NULL.

Value

tfr_table

Table storing the trajectories. It is a matrix with rows equal to number of trajectories, and column equal to number of time periods.

country.obj

A list storing information about the country which the trajectories and quantiles correspond to. It corresponds to the output of get.country.object.

tfr_quantile

Optional. A data.table object, storing the quantiles of estimates for each time period as specified by the probs argument. The time periods are contained in the year column.

Author(s)

Peiran Liu, Hana Sevcikova

Examples

## Not run: 
sim.dir <- tempfile()
m <- run.tfr.mcmc(nr.chains = 1, iter = 10, output.dir = sim.dir, uncertainty = TRUE)
get.tfr.estimation(m, "Nigeria", probs = c(0.1, 0.5, 0.9))
unlink(sim.dir, recursive = TRUE)
## End(Not run)

[Package bayesTFR version 7.0-4 Index]