Description Usage Arguments Details Value See Also Examples
View source: R/make_initial_popn.R
Randomly enerate an initial population based on expected population counts.
| 1 | make_initial_popn(expected_popn, poisson = FALSE, sd = 0)
 | 
| expected_popn | A  | 
| poisson | If  | 
| sd | A non-negative number, defaulting to 0. Governs extra variability in initial population, on top of Poisson variability. | 
When poisson is TRUE (the default)
the initial population counts are drawn
from Poisson
distributions centered at the expected values,
with some extra variation.
If c_{a,s} is the expected population size for
age group a and sex s,
then the initial population is generated using
n_{a,s} \sim Poisson(v_{a,s} c_{a, s})
where
\log(v_{a,s}) \sim N(0, b^2)
.
A value for b, which may be 0, is supplied by the user,
via the sd argument.
When poisson is FALSE, the initial
population counts are obtained simply by rounding
the expected values to the nearest integer.
A Counts object,
with the same dimensions as expected_popn.
| 1 2 3 4 5 6 7 8 9 | Lx <- dembase::Counts(Lx_west[ , , 20])
expected_popn <- make_stationary_popn(popn_size = 100,
                                    Lx = Lx,
                                    sex_ratio = 105)
make_initial_popn(expected_popn = expected_popn)
make_initial_popn(expected_popn = expected_popn,
                  sd = 0.05)
make_initial_popn(expected_popn = expected_popn,
                  poisson = FALSE)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.