View source: R/probability_contain.R
probability_contain | R Documentation |
Outbreak containment is defined as outbreak extinction when
simulate = FALSE
. When simulate = FALSE
, probability_contain()
is
equivalent to calling probability_extinct()
.
When simulate = TRUE
, outbreak containment is defined by the
case_threshold
(default = 100) and outbreak_time
arguments.
Firstly, case_threshold
sets the size of the transmission chain below
which the outbreak is considered contained. Secondly, outbreak_time
sets
the time duration from the start of the outbreak within which the outbreak
is contained if there is no more onwards transmission beyond this time.
When setting an outbreak_time
, a generation_time
is also required.
case_threshold
and outbreak_time
can be jointly set.
Overall, when simulate = TRUE
, containment is defined as the size and
time duration of a transmission chain not reaching the case_threshold
and outbreak_time
, respectively.
probability_contain(
R,
k,
num_init_infect,
ind_control = 0,
pop_control = 0,
simulate = FALSE,
...,
case_threshold = 100,
outbreak_time = Inf,
generation_time = NULL,
offspring_dist
)
R |
A |
k |
A |
num_init_infect |
An |
ind_control |
A |
pop_control |
A |
simulate |
A |
... |
< |
case_threshold |
A number for the threshold of the number of cases below
which the epidemic is considered contained. |
outbreak_time |
A number for the time since the start of
the outbreak to determine if outbreaks are contained within a given period
of time. |
generation_time |
A |
offspring_dist |
An |
When using simulate = TRUE
, the default arguments to simulate the
transmission chains with .chain_sim()
are 105 replicates,
a negative binomial (nbinom
) offspring distribution, parameterised with
R
(and pop_control
if > 0) and k
.
When setting the outbreak_time
argument, the generation_time
argument is
also required. The generation_time
argument requires a random number
generator function. For example, if we assume the generation time is
lognormally distributed with meanlog = 1
and sdlog = 1.5
, then we can
define the function
to pass to generation_time
as:
function(x) rlnorm(x, meanlog = 1, sdlog = 1.5)
A number
for the probability of containment.
Lloyd-Smith, J. O., Schreiber, S. J., Kopp, P. E., & Getz, W. M. (2005) Superspreading and the effect of individual variation on disease emergence. Nature, 438(7066), 355-359. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/nature04153")}
probability_extinct()
# population-level control measures
probability_contain(R = 1.5, k = 0.5, num_init_infect = 1, pop_control = 0.1)
# individual-level control measures
probability_contain(R = 1.5, k = 0.5, num_init_infect = 1, ind_control = 0.1)
# both levels of control measures
probability_contain(
R = 1.5,
k = 0.5,
num_init_infect = 1,
ind_control = 0.1,
pop_control = 0.1
)
# multi initial infections with population-level control measures
probability_contain(R = 1.5, k = 0.5, num_init_infect = 5, pop_control = 0.1)
# probability of containment within a certain amount of time
# this requires parameterising a generation time
gt <- function(n) {
rlnorm(n, meanlog = 1, sdlog = 1.5)
}
probability_contain(
R = 1.2,
k = 0.5,
num_init_infect = 1,
simulate = TRUE,
case_threshold = 50,
outbreak_time = 20,
generation_time = gt
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.