Estimates the time-varying effective reproduction number \(R_t\) directly from compartment data. Two methods are available:
"mechanistic"Uses \(R_t = \beta S(t) / (\gamma N)\). This is the standard formula for a frequency-dependent SIR-type model.
"normalized"Uses \(R_t = R_0 \, S(t) / N\) with \(R_0 = \beta / \gamma\). Suitable when different normalisations are desired.
Usage
plot_Rt_estimate(df, params, N = NULL, method = c("mechanistic", "normalized"))Arguments
- df
A data frame with columns
timeandS.- params
A named numeric vector or list containing at least
betaandgamma.- N
Total population size. If
NULL(the default), it is estimated from the sum of all state columns at the first time step.- method
Estimation method:
"mechanistic"(default) or"normalized".
Value
A ggplot object with a dashed horizontal line at \(R_t = 1\).
