SABS-R3-Epidemiology / seirmo

This is a project to model the outbreak of an infectious disease with the SEIR model.
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Add incidence flag to SEIRModel.simulate method #24

Closed DavAug closed 3 years ago

DavAug commented 3 years ago

Looking at the exercise sheet, epidemiological models like the SEIR model are often used to simulate the number of infections in a given time unit (often days). At the moment we are just returning the states (S, E, I, R), but the incidence number is the influx to I from time t_i to t_f, say from Tuesday to Wednesday. To be able to return the number of incidences we have to slightly modify the simulate function.

DavAug commented 3 years ago

As disussed it is probably best to avoid adding an additional state variable and compute n_incidence from I and R. For times = [t_0, t_1, ... , t_f] n_incidence can be computed as

total_infected = i + r
n_incidence = total_infected[1:] - total_infected[:-1]

i.e. [total_infected[t_1] - total_infected[t_0], [total_infected[t_2] - total_infected[t_1], ... ]