.sim_network_bp | R Documentation |
Simulate a branching process on a infinite network where the contact distribution provides a function to sample the number of contacts of each individual in the simulation. Each contact is then infected with the probability of infection. The time between each contact is assumed to be evenly distributed across the infectious period of the infected individual, and is independent of whether the contact becomes infected.
.sim_network_bp(
contact_distribution,
infectious_period,
prob_infection,
max_outbreak_size,
config
)
contact_distribution |
A The function can be defined or anonymous. The function must have a single
argument in the form of an An The default is an anonymous function with a Poisson probability mass function
( |
infectious_period |
A The function can be defined or anonymous. The function must return a vector of randomly generated real numbers representing sampled infectious periods. The function must have a single argument, the number of random infectious periods to generate. An The default is an anonymous function with a lognormal distribution random
number generator ( |
prob_infection |
A single |
config |
A list of settings to adjust the randomly sampled delays and
Ct values. See |
The contact distribution sampled takes the network effect
q(n) \sim (n + 1)p(n + 1)
where p(n)
is the probability
density function of a distribution, e.g., Poisson or Negative binomial.
That is to say, the probability of having choosing a contact at random by
following up a contact chooses individuals with a probability proportional
to their number of contacts. The plus one is because one of the contacts
was "used" to infect the person.
A <data.frame>
with the contact and transmission chain data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.