Skip to content
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

Use rounding for mortality #224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Use rounding for mortality #224

wants to merge 1 commit into from

Conversation

wenzeslaus
Copy link
Member

@wenzeslaus wenzeslaus commented Oct 24, 2024

Replaced flooring by rounding in computation of mortality in index/cohort for a cell.

Replaced flooring by rounding in computation of mortality in index/cohort for a cell.
@wenzeslaus
Copy link
Member Author

This causes the biggest changes in the outputs. Text output from r.pops.spread tests:

======================================================================
FAIL: test_outputs_mortality (__main__.TestSpread.test_outputs_mortality)
Check dead output of mortality
----------------------------------------------------------------------
...
AssertionError: r.univar map=average percentile=90.0 nprocs=1 separator== format=plain -g difference:
mismatch values (key, reference, actual): [('max', 6, 4.2), ('mean', 0.606, 0.14476843910806)]
command: r.univar map=average percentile=90.0 nprocs=1 separator== format=plain -g {'map': 'average', 'separator': '=', 'flags': 'g'}

======================================================================
FAIL: test_outputs_mortality_many_runs (__main__.TestSpread.test_outputs_mortality_many_runs)
Check mortality with many stochastic runs
----------------------------------------------------------------------
...
AssertionError: r.univar map=average percentile=90.0 nprocs=1 separator== format=plain -g difference:
mismatch values (key, reference, actual): [('mean', 0.653, 0.142562178387642)]
command: r.univar map=average percentile=90.0 nprocs=1 separator== format=plain -g {'map': 'average', 'separator': '=', 'flags': 'g'}

======================================================================
FAIL: test_outputs_mortality_pesticide_treatment (__main__.TestSpread.test_outputs_mortality_pesticide_treatment)
Check mortality together with pesticide treatment (all_infected_in_cell)
----------------------------------------------------------------------
...
AssertionError: r.univar map=dead_2022_12_31 percentile=90.0 nprocs=1 separator== format=plain -g difference:
mismatch values (key, reference, actual): [('mean', 0.675, 0.327151229273871)]
command: r.univar map=dead_2022_12_31 percentile=90.0 nprocs=1 separator== format=plain -g {'map': 'dead_2022_12_31', 'separator': '=', 'flags': 'g'}

======================================================================
FAIL: test_outputs_mortality_treatment (__main__.TestSpread.test_outputs_mortality_treatment)
Check mortality together with treatment
----------------------------------------------------------------------
...
AssertionError: r.univar map=dead_2019_12_31 percentile=90.0 nprocs=1 separator== format=plain -g difference:
mismatch values (key, reference, actual): [('sum', 782, 1196)]
command: r.univar map=dead_2019_12_31 percentile=90.0 nprocs=1 separator== format=plain -g {'map': 'dead_2019_12_31', 'separator': '=', 'flags': 'g'}

----------------------------------------------------------------------

@wenzeslaus wenzeslaus added the changes results Results will be different label Oct 24, 2024
@wenzeslaus
Copy link
Member Author

The rounding causes higher mortality which with time causes lower infection counts.

image

image

(infected is an average of number of infected over 5 runs; dead is accumulated number of dead in the first run; 50 runs seed 90385)

@wenzeslaus
Copy link
Member Author

The following figures are using mortality rate 0.4 for the new code which brings the results closer to the original code with mortality rate 0.5.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes results Results will be different
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant