Create a list of delay distributions to run the ringbp model
Usage
delay_opts(
incubation_period,
onset_to_isolation,
latent_period = 0,
onset_to_self_isolation = function(n) rep(Inf, n)
)Arguments
- incubation_period
a
function: a random number generatingfunctionthat samples from incubation period distribution, thefunctionaccepts a singleintegerargument specifying the number of times to sample the incubation period (i.e. length of thefunctionoutput).- onset_to_isolation
a
function: a random number generatingfunctionthat accepts a singleintegerargument specifying the length of thefunctionoutput.- latent_period
a non-negative
numericscalar: the minimum time between an individual being exposed and becoming infectious. It is a population-wide parameter, with no variability between individuals. It sets the minimum generation time in the model. Default is 0 (i.e. an individual becomes immediately infectious after being infected).If
latent_periodis positive then generation times are sampled conditional ongt >= latent_period(i.e. left-truncated atlatent_period). This may reduce the realised proportion of presymptomatic transmission, depending on theincubation_perioddistribution andpresymptomatic_transmission(inevent_prob_opts()).- onset_to_self_isolation
a
function: a random number generatingfunctionthat samples from the onset-to-self-isolation distribution, thefunctionaccepts a singleintegerargument specifying the length of thefunctionoutput.By default
onset_to_self_isolationis a function that generatesInf(i.e. individuals never self-isolate). A different onset-to-self-isolationfunctiononly needs to be specified if a non-zero value is specified tosymptomatic_self_isolateinevent_prob_opts()(which by default is 0). Ifonset_to_self_isolationis specified butsymptomatic_self_isolateis zero, a warning will be thrown and theonset_to_self_isolationwill be ignored; ifsymptomatic_self_isolateis non-zero andonset_to_self_isolationis anInfgenerating function,scenario_sim()will error.
Examples
delay_opts(
incubation_period = \(n) rweibull(n = n, shape = 2.32, scale = 6.49),
onset_to_isolation = \(n) rweibull(n = n, shape = 1.65, scale = 4.28)
)
#> $incubation_period
#> function (n)
#> rweibull(n = n, shape = 2.32, scale = 6.49)
#> <environment: 0x558fe1e97ad0>
#>
#> $onset_to_isolation
#> function (n)
#> rweibull(n = n, shape = 1.65, scale = 4.28)
#> <environment: 0x558fe1e97ad0>
#>
#> $latent_period
#> [1] 0
#>
#> $onset_to_self_isolation
#> function (n)
#> rep(Inf, n)
#> <environment: 0x558fe15e37e0>
#>
#> attr(,"class")
#> [1] "ringbp_delay_opts"