Skip to contents

Estimates the effective reproduction number (`R_est`) and a temporary reduction coefficient (`R_coeff_tmp`) based on epidemic simulation data, using the EpiEstim package.

Usage

R_epiestim(episimdata, Ygen, ii, R_est_wind = 5, r_dir = 0)

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.

Value

A list with two elements: - `R_est`: The estimated reproduction number. - `R_coeff_tmp`: The temporary estimate of the reduction coefficient.