Skip to contents

[Stable] Returns generation time parameters in a format for lower level model use.

Usage

generation_time_opts(
  dist = Fixed(1),
  ...,
  disease,
  source,
  max = 14,
  fixed = FALSE,
  prior_weight,
  tolerance = 0.001
)

Arguments

dist

A delay distribution or series of delay distributions . If no distribution is given a fixed generation time of 1 will be assumed.

...

deprecated; use dist instead

disease

deprecated; use dist instead

source

deprecated; use dist instead

max

deprecated; use dist instead

fixed

deprecated; use dist instead

prior_weight

deprecated; prior weights are now specified as a model option. Use the weigh_delay_priors argument of estimate_infections() instead.

tolerance

Numeric; the desired tolerance level.

Value

A <generation_time_opts> object summarising the input delay distributions.

Examples

# default settings with a fixed generation time of 1
generation_time_opts()
#> Warning: No generation time distribution given. Assuming a fixed generation time of 1 day, i.e. the reproduction number is the same as the daily growth rate. If this was intended then this warning can be silenced by setting `dist` explicitly to `Fixed(1)`.
#> - fixed value:
#>   1

# A fixed gamma distributed generation time
generation_time_opts(Gamma(mean = 3, sd = 2, max = 14))
#> - gamma distribution (max: 14):
#>   shape:
#>     2.2
#>   rate:
#>     0.75

# An uncertain gamma distributed generation time
generation_time_opts(
  Gamma(
    mean = Normal(mean = 3, sd = 1),
    sd = Normal(mean = 2, sd = 0.5),
    max = 14
  )
)
#> Warning: Uncertain gamma distribution specified in terms of parameters that are not the "natural" parameters of the distribution (shape, rate). Converting using a crude and very approximate method that is likely to produce biased results. If possible, it is preferable to specify the distribution directly in terms of the natural parameters.
#> - gamma distribution (max: 14):
#>   shape:
#>     - normal distribution:
#>       mean:
#>         2.2
#>       sd:
#>         0.72
#>   rate:
#>     - normal distribution:
#>       mean:
#>         0.75
#>       sd:
#>         0.41

# An example generation time
generation_time_opts(example_generation_time)
#> - gamma distribution (max: 14):
#>   shape:
#>     - normal distribution:
#>       mean:
#>         1.4
#>       sd:
#>         0.48
#>   rate:
#>     - normal distribution:
#>       mean:
#>         0.38
#>       sd:
#>         0.25