imperialCHEPI / healthgps

Global Health Policy Simulation model (Health-GPS)
https://imperialchepi.github.io/healthgps/
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Fix incorrect YLL and deaths in output #442

Closed jamesturner246 closed 1 week ago

jamesturner246 commented 2 weeks ago

Right now, YLL is computed as sum_over_dead_pop(years_lost_for_person * 100000) / n_alive, but this doesn't seem like 'true' YLL. Surely it's divided by either n_dead or n_dead + n_alive or something.

If Health-GPS states that the output value is YLL, then it should be YLL, not some intermediate value.

We need to figure this out and output something sensible.

jamesturner246 commented 2 weeks ago

After discussions, we found that yll is indeed incorrect, as is the deaths.

Right now the abs YLL sum and number of deaths are divided by n_active, which is clearly wrong. We should change it such that these values are divided by n_active + n_dead, or in other words, by the total population count after emigration (which includes immigrants).

Also change output to have the integer-only fields count_alive = n_active and count_dead = n_dead instead of what we have now: count = n_active and deaths = n_dead / n_active. Then you can get group size after migration by summing the two, and mortality rate by count_dead / (count_alive + count_dead).