delay_opts: Delay Distribution Options

View source: R/opts.R

delay_optsR Documentation

Delay Distribution Options

Description

[Stable] Returns delay distributions formatted for usage by downstream functions.

Usage

delay_opts(
  dist = Fixed(0),
  ...,
  fixed = FALSE,
  default_tolerance = 0.001,
  weight_prior = TRUE
)

Arguments

dist

A delay distribution or series of delay distributions. Default is a fixed distribution with all mass at 0, i.e. no delay.

...

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 ⁠<delay_opts>⁠ object summarising the input delay distributions.

See Also

convert_to_logmean() convert_to_logsd() bootstrapped_dist_fit() Distributions

Examples

# no delays
delay_opts()

# A single delay that has uncertainty
delay <- LogNormal(mean = Normal(1, 0.2), sd = Normal(0.5, 0.1), max = 14)
delay_opts(delay)

# A single delay without uncertainty
delay <- LogNormal(meanlog = 1, sdlog = 0.5, max = 14)
delay_opts(delay)

# Multiple delays (in this case twice the same)
delay_opts(delay + delay)

epiforecasts/EpiNow2 documentation built on Aug. 15, 2024, 8:12 a.m.