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

Gillespie alg #96

Closed KCGallagher closed 2 years ago

KCGallagher commented 2 years ago

Implements solve_gillespie algorithm (Closes #94)

codecov[bot] commented 2 years ago

Codecov Report

Merging #96 (9c40368) into main (8f5c3d6) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #96   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        11    +1     
  Lines          355       394   +39     
=========================================
+ Hits           355       394   +39     
Impacted Files Coverage Δ
seirmo/__init__.py 100.00% <100.00%> (ø)
seirmo/_gillespie.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8f5c3d6...9c40368. Read the comment docs.

KCGallagher commented 2 years ago

I have currently implemented that the algorithm will take no action in timesteps where the chosen process will remove individuals from an empty state, but am not sure if this is the desired behaviour (for example it could chose another action).

It should not be an issue in our model, as the propensity scales with the state population in all cases, but I have considered this for generalisability of the Gillespie algorithm.