# Simulate chain sizes with a poisson offspring distribution, assuming an
# infinite population and no immunity.
set.seed(32)
simulate_chain_stats(
n_chains = 20,
statistic = "size",
offspring_dist = rpois,
stat_threshold = 10,
lambda = 0.9
)
# Simulate chain sizes with a negative binomial distribution and assuming
# a finite population and 10% immunity.
set.seed(32)
simulate_chain_stats(
pop = 1000,
percent_immune = 0.1,
n_chains = 20,
statistic = "size",
offspring_dist = rnbinom,
stat_threshold = 10,
mu = 0.9,
size = 0.36
)
Run the code above in your browser using DataLab