-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Modelica epidemiological model is wrong #117
Comments
The model as programmed in 1 is taken from 2, page 713 (page 15 of pdf refered below). The Modelica model used (for direct simulation -- the model for parameter estimation as a slightly different initialization) in 1 was
I think the total population ( I believe the bug is actually an “inclusion” of the Footnotes
|
The model you suggest seems to be excellent from my point of view. Moreover, the fact that we can set |
The epidemiological model implemented in epid.mo is wrong. Indeed the simplest SIR equations are (see 1 page 455):
But the equation for$\frac{dS}{dt}$ is implemented as:
otfmi/otfmi/example/file/epid.mo
Line 18 in 6716944
The significant fact is that the right hand side of the ODE in the model does involve N: the model uses$\beta SI$ ) instead of $\beta SI / N$ ). This is wrong because it is not consistent with the initial number of infected $I(0)$ which is set to 1:
infection_rate * infected * susceptible
(i.e.infection_rate * infected * susceptible / total_pop
(i.e.otfmi/otfmi/example/file/epid.mo
Line 13 in 6716944
Actually, there are two different consistent choices.
der(susceptible)
,der(infected)
andder(removed)
in the .mo file is correct.der(susceptible)
,der(infected)
andder(removed)
in the current .mo file is wrong. This is the choice consistent with 2 figure 2 page 18 (the error must have been introduced later, because the Modelica model presented in 2 page 16 is correct).The consequence of the bug is the the beta variable does not have the value it should: the current code uses$\beta / N$ where it should use $\beta$ . Hence, the basic reproduction number $R_0 = \beta / \gamma$ is wrong. It is currently close to 0.005456, which is much smaller than the expected value of influenza. The correct value should be close to 4.163, i.e. 763 times much larger.
All in all, I suggest to use the following model, where the parameters are the infectious period (which is 1 / gamma) and the reproduction number (R0 = beta / gamma). These parameters are much easier to interpret and standard in the bibliography. Below, I use the parameters found in 1 figure 1 page 455. This leads to beta = 0.2143 (infection rate) and gamma = 1.0 / 14 = 0.07143 (healing rate).
When we simulate the model, we can compare to the results found at https://shiny.bcgsc.ca/posepi1/.
If we want to reproduce the results from 2, we may use these settings that I obtained after calibrating from the data found in 3 using non linear least squares, and rounded to 1 significant digits (I believe that the extra digits are not accurate, given the uncertainties in the data):
Updating these model will require to update the .fmu for Linux and Windows platforms available in the FMU directory.
Footnotes
Bjørnstad, O. N., Shea, K., Krzywinski, M., & Altman, N. (2020). Modeling infectious epidemics. Nature methods, 17(5), 455-457. ↩ ↩2
S. Girard, “A probabilistic take on system modeling with Modelica and Python”, Février 2019, https://sylvaingirard.net/pdf/girard17-probabilistic_modelica_python.pdf ↩ ↩2 ↩3
Anonymous (1978). ‘Influenza in a boarding school’. In: British Medical Journal 587.1. url: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1603269/?page=2. ↩
The text was updated successfully, but these errors were encountered: