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

InverseCDF returning potentially wrong values #255

Closed mghosh00 closed 3 months ago

mghosh00 commented 10 months ago

Describe the bug In line 56 of inverse_cdf.py (icdf_choose_no_exp), we have discovered that some people (potentially erroneously) return a value of 0. This implies that their transition time between statuses is equal to 0 and so the person will transition between multiple statuses in the same time step.

To Reproduce Steps to reproduce the behaviour:

  1. Add an if statement to check for value == 0 under line 56 of inverse_cdf.py
  2. Add a break point on this new line
  3. Run any functional test (e.g. test_distancing_functional.py) with the debugger
  4. Step through the code, and you will see that a person goes from Susceptible -> Exposed -> InfectGP in one time step using the while loop of line 313 in host_progression_sweep.py

Expected behaviour No person should step through multiple statuses in the same time step

Desktop (please complete the following information):

mghosh00 commented 9 months ago

Not sure if this is an issue or not, as in the wiki it states that icdf can return the value of 0. This does mean that some people transition from Susceptible -> Exposed -> Infect_{*} in one time step. This can be changed if necessary.

KCGallagher commented 3 months ago

This currently replicates behaviour from CovidSim - while I appreciate the concern I think that the is insufficent evidence to disprove the assertion that this transition may occur (with some small probability). While this is worth bearing in mind for future reporting methods, I will resolve this issue on that basis