Simulate NSUM Data
Description
This function simulates data from one of the four NSUM models.
Usage
1  nsum.simulate(n, known, unknown, N, model = "degree", ...)

Arguments
n 
a nonnegative integer, the number respondents in the sample. 
known 
a vector of positive numbers, the sizes of known subpopulations. 
unknown 
a vector of positive numbers, the sizes of unknown subpopulations. 
N 
a positive number, the (known) total population size. 
model 
a character string, the model to be simulated from. This must be one of 
... 
additional arguments to be passed to methods, such as starting values, prior parameters, and tuning parameters. Many methods will accept the following arguments:

Details
The function nsum.simulate
allows for the simulation of data from a random degree model based upon the Network Scale Up Method (NSUM). Options allow for the inclusion of barrier and transmission effects, both separately and combined, resulting in four models altogether. Each call to the function results in the simulation of a single realization of data.
Value
A list with two components:
y 
a matrix of nonnegagtive integers, the 
d 
a vector of positive numbers, the network degrees of the individuals. Only the integer parts were used for simulation. 
Author(s)
Rachael Maltiel and Aaron J. Baraff
Maintainer: Aaron J. Baraff <ajbaraff at uw.edu>
References
Maltiel, R., Raftery, A. E., McCormick, T. H., and Baraff, A. J., "Estimating Population Size Using the Network Scale Up Method." CSSS Working Paper 129. Retrieved from https://www.csss.washington.edu/Papers/2013/wp129.pdf
See Also
nsum.mcmc
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  ## load data
data(McCarty)
## simulate from model with barrier effects
sim.bar < with(McCarty, nsum.simulate(100, known, unknown, N, model="barrier",
mu, sigma, rho))
## simulate from model with both barrier effects and transmission biases
sim.comb < with(McCarty, nsum.simulate(100, known, unknown, N, model="combined",
mu, sigma, rho, tauK))
## extract data for use in MCMC
dat.bar < sim.bar$y
## view degree distribution
hist(sim.bar$d)
