Skip to contents

[Stable] Returns generation time parameters in a format for lower level model use. The generation time can either be given as a disease and source to be passed to get_generation_time, or as parameters of a distribution to be passed to dist_spec.

Usage

generation_time_opts(
  ...,
  disease,
  source,
  max = 15L,
  fixed = FALSE,
  prior_weight = NULL
)

Arguments

...

Any parameters to be passed to dist_spec(), if the generation time is given as parameters of a distribution rather than a disease and source. In this case if the mean parameter is not set a mean of 1 will be assumed, if the max parameter not set then the max will be set to 15 to ensure backwards compatibility, and if no dist parameter is given then a gamma distribution will be used for backwards compatibility. As for delay_opts() a list of parameters can also be supplied that describe a distribution (but unlike delay_opts() multiple distributions may not currently be used (for example as output by get_generation_time()).

disease

A character string indicating the disease of interest.

source

A character string indicating the source of interest.

max

Integer, defaults to 15. Maximum generation time. This will not be used if a maximum is set in the distribution parameters.

fixed

Logical, defaults to FALSE. Should the generation time be treated as coming from fixed (vs uncertain) distributions.

prior_weight

numeric, weight given to the generation time prior. By default the generation time prior will be weighted by the number of observation data points, usually preventing the posteriors from shifting much from the given distribution. Another sensible option would be 1, i.e. treating the generation time distribution as a single parameter.

Value

A list summarising the input delay distributions.

See also

convert_to_logmean convert_to_logsd bootstrapped_dist_fit dist_spec

Author

Sebastian Funk

Sam Abbott

Examples

# default settings with a fixed generation time
generation_time_opts()
#> $gt_mean_mean
#> [1] 1
#> 
#> $gt_mean_sd
#> [1] 0
#> 
#> $gt_sd_mean
#> [1] 0
#> 
#> $gt_sd_sd
#> [1] 0
#> 
#> $gt_fixed
#> [1] 1
#> 
#> $gt_max
#> [1] 1
#> 
#> $gt_dist
#> [1] 1
#> 

# A fixed gamma distributed generation time
generation_time_opts(mean = 3, sd = 2)
#> $gt_mean_mean
#> [1] 3
#> 
#> $gt_mean_sd
#> [1] 0
#> 
#> $gt_sd_mean
#> [1] 2
#> 
#> $gt_sd_sd
#> [1] 0
#> 
#> $gt_fixed
#> [1] 1
#> 
#> $gt_max
#> [1] 15
#> 
#> $gt_dist
#> [1] 1
#> 

# An uncertain gamma distributed generation time
generation_time_opts(mean = 3, sd = 2, mean_sd = 1, sd_sd = 0.5)
#> $gt_mean_mean
#> [1] 3
#> 
#> $gt_mean_sd
#> [1] 1
#> 
#> $gt_sd_mean
#> [1] 2
#> 
#> $gt_sd_sd
#> [1] 0.5
#> 
#> $gt_fixed
#> [1] 0
#> 
#> $gt_max
#> [1] 15
#> 
#> $gt_dist
#> [1] 1
#>