Description Usage Arguments Details Value Vignettes Author(s) References
View source: R/pop_reconstruction_functions.R
Draws an MCMC sample from the joint posterior distribution of agespecific fertility rates, survival and migration proportions and baseline population counts.
1 2 3 4 5 6 7  popRecon.sampler(n.iter, burn.in = 0, thin.by = 1, al.f = 1, be.f = 0.0109,
al.s = 1, be.s = 0.0109, al.g = 1, be.g = 0.0436, al.n = 1, be.n = 0.0109,
mean.f, mean.s, mean.g, mean.b, start.f = mean.f, start.s = mean.s,
start.g = mean.g, start.b = mean.b, start.sigmasq.f = 5, start.sigmasq.s = 5,
start.sigmasq.g = 5, start.sigmasq.n = 5, pop.data, prop.vars,
ccmp.function = popRecon.ccmp.female, proj.periods = ncol(mean.f),
age.size = 5, verb = FALSE, s.tol = 10^(10))

n.iter 
Number of iterations to save. 
burn.in 
Number of burnin iterations; not saved. 
thin.by 
Thinning parameter; save every 'thin'th iteration. 
al.f 
Shape parameter of the distribution of the variance of the agespecific ferility rate initial estimates. 
be.f 
Scale parameter of the distribution of the variance of the agespecific ferility rate initial estimates. 
al.s 
Shape parameter of the distribution of the variance of the agespecific survival proportion initial estimates. 
be.s 
Scale parameter of the distribution of the variance of the agespecific survival proportion initial estimates. 
al.g 
Shape parameter of the distribution of the variance of the agespecific migration proportion initial estimates. 
be.g 
Scale parameter of the distribution of the variance of the agespecific migration proportion initial estimates. 
al.n 
Shape parameter of the distribution of the variance of the agespecific population count initial estimates and census counts. 
be.n 
Scale parameter of the distribution of the variance of the agespecific population count initial estimates and census counts. 
mean.f 
Matrix of initial estimates of agespecific fertility rates with age groups as rows, time periods as columns. 
mean.s 
Matrix of initial estimates of agespecific survival proportions with age groups as rows, time periods as columns. 
mean.g 
Matrix of initial estimates of agespecific migration proportions with age groups as rows, time periods as columns. 
mean.b 
Matrix of initial estimates of agespecific baseline population counts with age groups as rows, time periods as columns. 
start.f 
Matrix of MCMC start values of agespecific fertility rates with age groups as rows, time periods as columns. 
start.s 
Matrix of MCMC start values of agespecific survival proportions with age groups as rows, time periods as columns. 
start.g 
Matrix of MCMC start values of agespecific migration proportions with age groups as rows, time periods as columns. 
start.b 
Matrix of MCMC start values of agespecific baseline population counts with age groups as rows, time periods as columns. 
start.sigmasq.f 
MCMC start value for variance of the agespecific fertility rate initial estimates. 
start.sigmasq.s 
MCMC start value for variance of the agespecific survival proportions initial estimates. 
start.sigmasq.g 
MCMC start value for variance of the agespecific migration proportions initial estimates. 
start.sigmasq.n 
MCMC start value for variance of the agespecific baseline count initial estimates. 
pop.data 
Matrix fo census counts, with age groups as rows, time periods as columns. 
prop.vars 
List of matrices of variances for Gaussian Metropolis random walk proposals. Components are 
ccmp.function 
Function to do cohort component projection. 
proj.periods 
Number of age.sizeyear periods to over which to do the reconstruction, beginning at the baseline year. 
age.size 
Width of the age groups and time periods in years. 
verb 
Logical; should progress messages be printed. 
s.tol 
A tolerance parameter to stop over/underflow when taking logits of survival proportions. 
This is the main function of the popReconstruct package. It takes initial estimates of agespecific vital rates, migration proportions and population counts in the baseline year and draws an MCMC sample from the joint posterior distribution defined in Wheldon et al. (2011). See the vignette burkinafasofemales for an extended illustration of its use.
A list with components;
fert.rate.mcmc 
mcmc object containing MCMC chains for agespecific fertility rates. 
surv.prop.mcmc 
mcmc object containing MCMC chains for agespecific survival proportions. 
mig.prop.mcmc 
mcmc object containing MCMC chains for agespecific migration proportions. 
baseline.count.mcmc 
mcmc object containing MCMC chains for agespecific baseline counts. 
lx.mcmc 
mcmc object containing MCMC chains for agespecific population counts at years subsequent to baseline. 
variances.mcmc 
mcmc object containing MCMC chains for the vital rate variance parameters. 
alg.stats 
“algorithm statistics”; a list with components

fixed.params 
A list containing the initial estimates and hyperparmaters of the variance distributions. 
start.vals 
A list containing Metropolis start values for the vital rates, migration proportions, baseline counts and variance parameters. 
alg.params 
“algorithm parameters”; a list returning some
of the arguments supplied for this run, saved for later
reference. For example, Metropolis proposal variances
( 
burkinafasofemales
Mark C. Wheldon
Wheldon, M. C., Raftery, A. E., Clark, S. J. and Gerland, P. (2011) Estimating Demographic Parameters with Uncertainty. Working Paper No. 108, Center for Statistics and the Social Sciences, University of Washington, Seattle. http://www.csss.washington.edu/Papers/wp108.pdf.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.