Estimate Reproduction Number (R) and Reduction Coefficient Using EpiEstim
R_epiestim.RdEstimates the effective reproduction number (`R_est`) and a temporary reduction coefficient (`R_coeff_tmp`) based on epidemic simulation data, using the EpiEstim package.
Arguments
- episimdata
A data frame containing epidemic simulation data. It must include the following columns: - `C`: Number of cases. - `Lambda_C`: Total infectiousness (typically computed from past cases). - `R_coeff`: Reduction coefficient representing the effect of interventions on transmission.
- Ygen
A numeric vector representing the generation time distribution.
- ii
An integer indicating the current time step in the simulation.
- R_est_wind
An integer specifying the window size used for estimating `R` (default is 5).
- r_dir
An integer indicating how the reduction coefficient is averaged: - If `1`, uses a simple mean over the estimation window. - Otherwise, uses a weighted average based on the generation distribution.