Skip to contents

[Experimental] Convenience function to extract a single delay distribution by name. This is equivalent to get_delays(object)[[type]] but provides a cleaner interface.

Usage

get_delay(object, type, ...)

# Default S3 method
get_delay(object, type, ...)

Arguments

object

A fitted model object (e.g., from estimate_infections(), estimate_secondary(), or estimate_truncation())

type

Character string specifying the delay type to extract. Common values include "generation_time", "reporting", and "truncation". Use names(get_delays(object)) to see available types.

...

Additional arguments passed to methods

Value

A dist_spec object representing the requested delay distribution, or NULL if the specified type is not found.

See also

get_delays() to retrieve all delay distributions as a list

Examples

if (FALSE) { # \dontrun{
# Get truncation delay from estimate_truncation
trunc_dist <- get_delay(fit, "truncation")

# Get generation time from estimate_infections
gt <- get_delay(fit, "generation_time")
} # }