Skip to contents

This function projects epidemic progression based on given parameters, simulating infections and deaths over a prediction window. It incorporates intervention effects and computes expected reward values.

Usage

Epi_pred_wd(
  episimdata,
  episettings,
  epi_par,
  noise_par,
  actions,
  pathogen,
  pred_days,
  r_dir,
  kk,
  jj,
  N,
  ndays = nrow(episimdata),
  pred_susceptibles = 0,
  gamma = 0.95
)

Arguments

episimdata

A data frame containing simulation data. It should include columns such as "C" (cases), "I" (infected individuals), "Re" (effective reproduction number), "S" (susceptible individuals), "Deaths", and "Lambda".

epi_par

A data frame containing epidemiological parameters for various pathogens. It should have the following columns: "R0" (basic reproduction number), "gen_time" (generation time), "gen_time_var" (variance of generation time), "CFR" (case fatality rate), "mortality_mean", and "mortality_var".

noise_par

A placeholder for surveillance noise parameters. Not used in projections.

actions

A data frame containing control actions. Column 2 is expected to modify the effective reproduction number ("Re").

pathogen

An integer specifying the pathogen to extract corresponding epidemiological parameters.

pred_days

An integer specifying the number of days to predict ahead.

r_dir

An integer specifying the reproduction number adjustments:

  • 1 for direct Re.

  • 2 for logistic adjustments.

  • 0 for using the generation time distribution.

kk

An integer indicating the starting day for prediction within the simulation.

jj

An integer specifying the row index in actions to use for control effects.

N

A numeric value representing the total population size.

ndays

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

pred_susceptibles

A binary (0 or 1) indicating whether to update the number of susceptibles during the simulation. Defaults to 0.

gamma

A numeric value between 0 and 1 representing the discount factor for future rewards. Defaults to 0.95. Smaller values will prioritise immediate rewards over longer term rewards.

Value

A numeric value representing the expected discounted reward over the prediction window.

Details

The function simulates the epidemic using specified parameters and computes rewards for each day within the prediction window. Rewards are calculated using the reward_fun_wd function and are discounted exponentially using the discount factor gamma.

Examples

# Example epidemiological data
episimdata <- data.frame(R0est = c(1.5, 1.6), C = c(0, 10), Re = c(NA, NA), S = c(1000, 990), Deaths = c(0, 1))
epi_par <- data.frame(
  R0 = c(2.5), gen_time = c(5), gen_time_var = c(1),
  CFR = c(0.02), mortality_mean = c(14), mortality_var = c(2)
)
actions <- data.frame(action_effect = c(0.9, 0.8))
Epi_pred_wd(
  episimdata = episimdata, epi_par = epi_par, noise_par = NULL,
  actions = actions, pathogen = "pathogen1", pred_days = 10,
  r_dir = 1, kk = 2, jj = 1, N = 1000, ndays = 20
)
#> Error in Epi_pred_wd(episimdata = episimdata, epi_par = epi_par, noise_par = NULL,     actions = actions, pathogen = "pathogen1", pred_days = 10,     r_dir = 1, kk = 2, jj = 1, N = 1000, ndays = 20): argument "episettings" is missing, with no default