Create a list of offspring distributions to run the ringbp model
Arguments
- community
a
function
: a random number generatingfunction
that samples from the community (non-isolated) offspring distribution, thefunction
accepts a singleinteger
argument specifying the number of times to sample the offspring distribution (i.e. the length of thefunction
output)- isolated
a
function
: a random number generatingfunction
that samples from the isolated cases offspring distribution, thefunction
accepts a singleinteger
argument specifying the number of times to sample the offspring distribution (i.e. the length of thefunction
output)- asymptomatic
a
function
: a random number generatingfunction
that samples from the sub-clinical non-isolated cases offspring distribution, thefunction
accepts a singleinteger
argument specifying the number of times to sample the offspring distribution (i.e. the length of thefunction
output). Will be specified as the same as thecommunity
offspring distribution if left unspecified
Details
If asymptomatic
is not provided it will be specified as the same as
community
meaning transmission of subclinical cases to be equal to
clinical cases unless specified otherwise.
Examples
# Negative binomial offspring distributions with:
# Community R0 of 2.5 and dispersion of 0.16
# Isolated R0 of 0.5 and dispersion of 1
# Asymptomatic R0 of 2.5 and dispersion of 0.16
offspring_opts(
community = \(n) rnbinom(n = n, mu = 2.5, size = 0.16),
isolated = \(n) rnbinom(n = n, mu = 0.5, size = 1),
asymptomatic = \(n) rnbinom(n = n, mu = 2.5, size = 0.16)
)
#> $community
#> function (n)
#> rnbinom(n = n, mu = 2.5, size = 0.16)
#> <environment: 0x55d1248b6808>
#>
#> $isolated
#> function (n)
#> rnbinom(n = n, mu = 0.5, size = 1)
#> <environment: 0x55d1248b6808>
#>
#> $asymptomatic
#> function (n)
#> rnbinom(n = n, mu = 2.5, size = 0.16)
#> <environment: 0x55d1248b6808>
#>
#> attr(,"class")
#> [1] "ringbp_offspring_opts"