Skip to contents

This function simulates epidemic dynamics using a predefined set of parameters and estimates reproduction numbers based on the reported deaths.

Usage

Epi_MPC_run_est_D(
  episimdata,
  episettings,
  epi_par,
  noise_par,
  actions,
  pred_days,
  n_ens = 100,
  start_day = 1,
  ndays = nrow(episimdata),
  R_est_wind = 5,
  pathogen = 1,
  susceptibles = 1,
  delay = 0,
  ur = 0,
  r_dir = 1,
  N = 1e+06
)

Arguments

episimdata

A data frame containing simulation data. It should include columns for:

  • "I": Number of infected individuals.

  • "C": Reported cases.

  • "S": Number of susceptible individuals.

  • "Lambda": Total infectiousness.

  • "Deaths": Number of deaths.

  • "Lambda_C": Total infectiousness derived from cases.

  • "S": Number of susceptible individuals.

  • "R_coeff": Coefficient of reproduction number reduction by policy.

epi_par

A data frame of epidemiological parameters, including:

  • "R0": Basic reproduction number.

  • "gen_time": Disease mean generation time.

  • "gen_time_var": Variance of the generation time.

  • "CFR": Case fatality rate.

  • "mortality_mean": Mean delay for mortality.

  • "mortality_var": Variance of mortality delay.

noise_par

A data frame containing noise parameters:

  • "repd_mean": Reporting delay mean.

  • "del_disp": Dispersion parameter for reporting delays.

  • "ur_mean": Mean under-reporting rate.

  • "ur_beta_a": Alpha parameter of Beta distribution for under-reporting.

actions

A data frame containing policy actions with reproduction coefficients ("R_coeff").

pred_days

An integer specifying the number of days to predict ahead during policy evaluation.

n_ens

An integer specifying the number of ensemble runs for Monte Carlo simulations. Defaults to 100.

start_day

An integer indicating the start day of the simulation. Defaults to 1.

ndays

An integer specifying the total number of simulation days. Defaults to the number of rows in episimdata.

R_est_wind

An integer specifying the rolling window size for reproduction number estimation. Defaults to 5.

pathogen

An integer specifying the pathogen to extract corresponding epidemiological parameters. Defaults to 1.

susceptibles

A binary value (0 or 1) indicating whether to simulate changes in susceptibles. Defaults to 1.

delay

A binary value (0 or 1) indicating whether to simulate reporting delays. Defaults to 0.

ur

A binary value (0 or 1) indicating whether to simulate under-reporting. Defaults to 0.

r_dir

An integer indicating reproduction number adjustments:

  • 1 for direct Re.

  • 2 for logistic adjustments.

  • 0 for using the generation time distribution.

N

A numeric value representing the total population size. Defaults to 1e6.

Value

A data frame containing updated simulation data with computed reproduction numbers, estimated policies, daily infection incidents, cases, deaths, and other epidemic metrics.

Details

The function estimates reproduction numbers (R0est) based on deaths ("Deaths") using a rolling window approach. Policies are evaluated periodically using a Monte Carlo strategy, and optimal policies are selected based on the highest expected rewards.

Examples

# Example data and parameters
episimdata <- data.frame(I = c(10, 20), Deaths = c(1, 2), Lambda_C = c(10, 15), S = c(1000, 990), R_coeff = c(1.0, 0.9))
epi_par <- data.frame(
  R0 = 2.5, gen_time = 5, gen_time_var = 1, CFR = 0.02,
  mortality_mean = 14, mortality_var = 2
)
noise_par <- data.frame(
  repd_mean = 2, del_disp = 1.5, ur_mean = 0.8, ur_beta_a = 2
)
actions <- data.frame(R_coeff = c(1.0, 0.3))
results <- Epi_MPC_run_est_D(
  episimdata = episimdata, epi_par = epi_par, noise_par = noise_par,
  actions = actions, pred_days = 10, n_ens = 50, start_day = 1,
  ndays = 20, R_est_wind = 5, pathogen = 1, susceptibles = 1,
  delay = 0, ur = 0, r_dir = 1, N = 1e6
)
#> Error in Epi_MPC_run_est_D(episimdata = episimdata, epi_par = epi_par,     noise_par = noise_par, actions = actions, pred_days = 10,     n_ens = 50, start_day = 1, ndays = 20, R_est_wind = 5, pathogen = 1,     susceptibles = 1, delay = 0, ur = 0, r_dir = 1, N = 1e+06): argument "episettings" is missing, with no default