SABS-R3-Epidemiology / epiabm

Epidemiological agent-based modelling packages in both python and C++. Published at: https://doi.org/10.5334/jors.449.
BSD 3-Clause "New" or "Revised" License
15 stars 5 forks source link

Keeping track of secondary infections #262

Open mghosh00 opened 7 months ago

mghosh00 commented 7 months ago

Is your feature request related to a problem? Please describe. We wish to record the number of people each person infects over the course of the epidemic (each time they are re-infected) so that we can find the R_t value at each time step. The dataframes produced will be further used in the sampling package EpiOS.

Describe the solution you'd like I will change the Person class to record a list of secondary infections each person has during the epidemic. I will also update the simulation to record and output a dataframe containing this information.

mghosh00 commented 7 months ago

Classes and functions to update:

core

output

property

routine

sweep

mghosh00 commented 7 months ago

Structure of output dataframe

Here is a template for what the output dataframe will look like (maybe not including R_t but is there to illustrate):

time person A person B person C person D ... person Z R_t
0.0 nan nan 5 nan ... 0 2.5
1.0 3 nan nan nan ... nan 3.0
2.0 nan nan nan nan ... nan 0.0
3.0 nan nan nan 3 ... nan 3.0
4.0 nan 6 nan nan ... 2 4.0

In this scenario, here are the lists of days in which each person becomes infected: A: 1.0 - goes on to infect 3 others B: 4.0 - goes on to infect 6 others C: 0.0 - goes on to infect 5 others D: 3.0 - goes on to infect 3 others E: 0.0 - goes on to infect 0 others, reinfected at 4.0 goes on to infect 2 others

mghosh00 commented 4 months ago

Tracking the serial interval of the epidemic

We wish to also take into account the serial interval. For every infection event, the time between the infector's infection_time and the infectee's infection_time will be recorded, and back-tracked to the timestep for which the infector was infected. Then we record a histogram of the these times for each timestep.

Example: time person A person B person C person D person E person F
0.0 gets infected
1.0 infects B, C gets infected by A gets infected by A
2.0 infects D gets infected by B
3.0 infects E infects F gets infected by A gets infected by C

In this scenario, the serial interval vectors look like: 0.0: [1, 1, 3] - A infects B (1), C (1) and E (3) 1.0: [1, 2] - B infects D (1), C infects F (2) 2.0: [] - D infects no-one 3.0: [] - E and F infect no-one

mghosh00 commented 4 months ago

Classes and functions to update:

core

routine

sweep