generation_time_opts: Generation Time Distribution Options

gt_optsR Documentation

Generation Time Distribution Options

Description

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

Usage

gt_opts(
  dist = Fixed(1),
  ...,
  disease,
  source,
  max = 14,
  fixed = FALSE,
  default_tolerance = 0.001,
  weight_prior = TRUE
)

generation_time_opts(
  dist = Fixed(1),
  ...,
  disease,
  source,
  max = 14,
  fixed = FALSE,
  default_tolerance = 0.001,
  weight_prior = TRUE
)

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

default_tolerance

Numeric; default tolerance to be used if an unconstrained distribution is passed as dist. If dist is already constrained by having a maximum or tolerance this is ignored.

weight_prior

Logical; if TRUE (default), any priors given in dist will be weighted by the number of observation data points, in doing so approximately placing an independent prior at each time step and usually preventing the posteriors from shifting. If FALSE, no weight will be applied, i.e. any parameters in dist will be treated as a single parameters.

Value

A ⁠<generation_time_opts>⁠ object summarising the input delay distributions.

See Also

convert_to_logmean() convert_to_logsd() bootstrapped_dist_fit() Gamma() LogNormal() Fixed()

Examples

# default settings with a fixed generation time of 1
generation_time_opts()

# A fixed gamma distributed generation time
generation_time_opts(Gamma(mean = 3, sd = 2, max = 14))

# 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
  )
)

# An example generation time
gt_opts(example_generation_time)

epiforecasts/EpiNow2 documentation built on Aug. 24, 2024, 5:53 p.m.