Skip to contents

Finds the first time where an aggregated incidence stream reaches or exceeds a threshold.

Usage

chlaa_trigger_time_from_sim(sim, threshold, var = "inc_symptoms", fun = mean)

Arguments

sim

Output of `chlaa_simulate()` (or a single-scenario subset of `chlaa_run_scenarios()`).

threshold

Numeric threshold.

var

Variable name in `sim` to threshold on. Defaults to `inc_symptoms`.

fun

Aggregation function across particles at each time (defaults to `mean`).

Value

A single numeric trigger time (same units as `sim$time`), or `NA_real_` if never reached.