max.dist_spec: Returns the maximum of one or more delay distribution

View source: R/dist_spec.R

max.dist_specR Documentation

Returns the maximum of one or more delay distribution

Description

[Experimental] This works out the maximum of all the (parametric / nonparametric) delay distributions combined in the passed <dist_spec> (ignoring any uncertainty in parameters)

Usage

## S3 method for class 'dist_spec'
max(x, ...)

Arguments

x

The <dist_spec> to use

...

Not used

Value

A vector of means.

Examples

# A fixed gamma distribution with mean 5 and sd 1.
dist1 <- Gamma(mean = 5, sd = 1, max = 20)
max(dist1)

# An uncertain lognormal distribution with meanlog and sdlog normally
# distributed as Normal(3, 0.5) and Normal(2, 0.5) respectively
dist2 <- LogNormal(
  meanlog = Normal(3, 0.5),
  sdlog = Normal(2, 0.5),
  max = 20
)
max(dist2)

# The max the sum of two distributions
max(dist1 + dist2)

epiforecasts/EpiNow2 documentation built on Dec. 20, 2024, 10:12 p.m.