ashokkrish / episim

episim is an R Shiny app for mathematical modelling of infectious diseases
GNU General Public License v3.0
3 stars 3 forks source link

Dead compartment, but not Exposed compartment, present in output from `ehpi::epi` #127

Open bryce-carson opened 2 months ago

bryce-carson commented 2 months ago

The current code uses dplyr::select to remove the columns from the output dataframe which are not part of the model, because all the observations within such compartments are equal to zero (because they're irrelevant and defaulted to zero in the implementation).

The use of dplyr::select removes the Dead compartment, which is present in the output of an SIR model, however I would expect that the Exposed compartment would also be present and removed by dplyr, but it's not present in the output. This leads me to the question, why is dplyr::select necessary here at all? Why is Dead present in the output at all when the model is SIR, and why isn't Exposed present and also entirely zero? It's not included at all!

Before dplyr::select removes the compartment(s) which are not part of the model.

 doCall(epi, args = req(visibleInputs()))
   time   N         S          I           R D
1     1 500 499.00000   1.000000   0.0000000 0
2     2 500 498.38721   1.489910   0.1228788 0
3     3 500 497.47595   2.218159   0.3058875 0
4     4 500 496.12313   3.298677   0.5781961 0
5     5 500 494.11976   4.897419   0.9828174 0
6     6 500 491.16397   7.253219   1.5828071 0
7     7 500 486.82663  10.703570   2.4698051 0
8     8 500 480.51244  15.712257   3.7752987 0
9     9 500 471.42609  22.889533   5.6843796 0
10   10 500 458.56519  32.984443   8.4503677 0
11   11 500 440.78083  46.813338  12.4058374 0
12   12 500 416.96096  65.077694  17.9613473 0
13   13 500 386.37778  88.043202  25.5790206 0
14   14 500 349.15536 115.135775  35.7088626 0
15   15 500 306.65465 144.657011  48.6883392 0
16   16 500 261.46212 173.906235  64.6316478 0
17   17 500 216.81080 199.831071  83.3581251 0
18   18 500 175.66584 219.931861 104.4022954 0
19   19 500 139.98726 232.907280 127.1054635 0
20   20 500 110.51589 238.739530 150.7445827 0
21   21 500  87.02146 238.333572 174.6449705 0
22   22 500  68.72583 233.026255 198.2479102 0
23   23 500  54.66772 224.199165 221.1331185 0
24   24 500  43.92546 213.063458 243.0110824 0
25   25 500  35.71578 200.582958 263.7012624 0
bryce-carson commented 2 months ago

The issue is inconsequential to the operation of the application, but might lead to some other issue in the future (i.e. following some future change) if not addressed.