dsizeprior {sspse} | R Documentation |
Prior distributions for the size of a hidden population
Description
dsizeprior
computes the prior distribution of the population
size of a hidden population. The prior is intended to be used in Bayesian
inference for the population size based on data collected by Respondent
Driven Sampling, but can be used with any Bayesian method to estimate
population size.
Usage
dsizeprior(
n,
type = c("beta", "nbinom", "pln", "flat", "continuous", "supplied"),
mean.prior.size = NULL,
sd.prior.size = NULL,
mode.prior.sample.proportion = NULL,
median.prior.sample.proportion = NULL,
median.prior.size = NULL,
mode.prior.size = NULL,
quartiles.prior.size = NULL,
effective.prior.df = 1,
alpha = NULL,
beta = NULL,
maxN = NULL,
log = FALSE,
maxbeta = 120,
maxNmax = 2e+05,
supplied = list(maxN = maxN),
verbose = TRUE
)
Arguments
n |
count; the sample size. |
type |
character; the type of parametric distribution to use for the
prior on population size. The options are |
mean.prior.size |
scalar; A hyperparameter being the mean of the prior distribution on the population size. |
sd.prior.size |
scalar; A hyperparameter being the standard deviation of the prior distribution on the population size. |
mode.prior.sample.proportion |
scalar; A hyperparameter being the mode
of the prior distribution on the sample proportion |
median.prior.sample.proportion |
scalar; A hyperparameter being the
median of the prior distribution on the sample proportion |
median.prior.size |
scalar; A hyperparameter being the mode of the prior distribution on the population size. |
mode.prior.size |
scalar; A hyperparameter being the mode of the prior distribution on the population size. |
quartiles.prior.size |
vector of length 2; A pair of hyperparameters
being the lower and upper quartiles of the prior distribution on the
population size. For example, |
effective.prior.df |
scalar; A hyperparameter being the effective number of samples worth of information represented in the prior distribution on the population size. By default this is 1, but it can be greater (or less!) to allow for different levels of uncertainty. |
alpha |
scalar; A hyperparameter being the first parameter of the Beta prior model for the sample proportion. By default this is NULL, meaning that 1 is chosen. it can be any value at least 1 to allow for different levels of uncertainty. |
beta |
scalar; A hyperparameter being the second parameter of the Beta prior model for the sample proportion. By default this is NULL, meaning that 1 is chosen. it can be any value at least 1 to allow for different levels of uncertainty. |
maxN |
integer; maximum possible population size. By default this is determined from an upper quantile of the prior distribution. |
log |
logical; return the prior or the the logarithm of the prior. |
maxbeta |
integer; maximum beta in the prior for population size. By default this is determined to ensure numerical stability. |
maxNmax |
integer; maximum possible population size. By default this is determined to ensure numerical stability. |
supplied |
list; If the argument |
verbose |
logical; if this is |
Value
dsizeprior
returns a list consisting of the following
elements:
x |
vector; vector of degrees |
lpriorm |
vector; vector of probabilities
corresponding to the values in |
N |
scalar; a starting value for the population size computed from the prior. |
maxN |
integer; maximum possible population size. By default this is determined from an upper quantile of the prior distribution. |
mean.prior.size |
scalar; A hyperparameter being the mean of the prior distribution on the population size. |
mode.prior.size |
scalar; A hyperparameter being the mode of the prior distribution on the population size. |
effective.prior.df |
scalar; A hyperparameter being the effective number of samples worth of information represented in the prior distribution on the population size. By default this is 1, but it can be greater (or less!) to allow for different levels of uncertainty. |
mode.prior.sample.proportion |
scalar; A hyperparameter
being the mode of the prior distribution on the sample proportion
|
median.prior.size |
scalar; A hyperparameter being the mode of the prior distribution on the population size. |
beta |
scalar; A
hyperparameter being the second parameter of the Beta distribution that is a
component of the prior distribution on the sample proportion |
type |
character; the type of parametric distribution to use for the
prior on population size. The possible values are |
Details on priors
The best way to specify the prior is via the
hyperparameter mode.prior.size
which specifies the mode of the prior
distribution on the population size. You can alternatively specify the
hyperparameter median.prior.size
which specifies the median of the
prior distribution on the population size, or mode.prior.sample
proportion
which specifies the mode of the prior distribution on the
proportion of the population size in the sample.
References
Gile, Krista J. (2008) Inference from Partially-Observed Network Data, Ph.D. Thesis, Department of Statistics, University of Washington.
Gile, Krista J. and Handcock, Mark S. (2010) Respondent-Driven Sampling: An Assessment of Current Methodology, Sociological Methodology 40, 285-327.
Gile, Krista J. and Handcock, Mark S. (2014) sspse: Estimating Hidden Population Size using Respondent Driven Sampling Data R package, Los Angeles, CA. Version 0.5, https://hpmrg.org/sspse/.
Handcock MS (2003). degreenet: Models for Skewed Count Distributions Relevant to Networks. Statnet Project, Seattle, WA. Version 1.2, https://statnet.org/.
Handcock, Mark S., Gile, Krista J. and Mar, Corinne M. (2014) Estimating Hidden Population Size using Respondent-Driven Sampling Data, Electronic Journal of Statistics, 8, 1, 1491-1521
Handcock, Mark S., Gile, Krista J. and Mar, Corinne M. (2015) Estimating the Size of Populations at High Risk for HIV using Respondent-Driven Sampling Data, Biometrics.
See Also
network, statnet, degreenet
Examples
prior <- dsizeprior(n=100,
type="beta",
mode.prior.size=1000)