Skip to contents

This function visualizes the assumed shedding durations and corresponding recovery rates (1/duration) for symptomatic and asymptomatic cholera infections using transparent bars and solid mean lines. Recovery duration is shown on the x-axis.

Usage

plot_recovery_duration(
  PATHS = NULL,
  symp_range = c(3.8, 26.6),
  asymp_range = c(0.9, 4.4),
  symp_central = 10,
  asymp_central = 2
)

Arguments

PATHS

Optional list containing output paths. If provided, must include DOCS_FIGURES where plot will be saved.

symp_range

A numeric vector of length 2 indicating the lower and upper shedding-duration bound (in days) for symptomatic infections. Default is the 95% credible interval of the canonical lognormal prior gamma_1 ~ Lognormal(-2.303, 0.5), i.e. c(3.8, 26.6) days.

asymp_range

A numeric vector of length 2 indicating the lower and upper shedding-duration bound (in days) for asymptomatic infections. Default is the 95% credible interval of the canonical lognormal prior gamma_2 ~ Lognormal(-0.693, 0.4), i.e. c(0.9, 4.4) days.

symp_central

A single numeric giving the central duration (typically the median) for symptomatic infections. Default 10 days (median of gamma_1 prior). The vertical solid line in the plot is drawn here. If NA, falls back to the arithmetic midpoint of symp_range.

asymp_central

A single numeric giving the central duration (typically the median) for asymptomatic infections. Default 2 days (median of gamma_2 prior).

Value

Invisibly returns the ggplot object. If PATHS is supplied, also saves a PNG.

Details

If a list PATHS is provided with a valid DOCS_FIGURES element, the plot will also be saved as a PNG in that directory as "recovery_rates.png".

Examples

plot_recovery_duration()
plot_recovery_duration(symp_range = c(4, 6), asymp_range = c(8, 12),
                       symp_central = 5, asymp_central = 10)