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

Make demography predetermine mortality at the first step of simulation rather than scheduling multiple times #31

Open
RobertManningSmith opened this issue Apr 26, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@RobertManningSmith
Copy link
Collaborator

Currently mortality is initially decided at the start of the year. Those who are determined to die do so, those that aren't have their mortality decided again once the next simulation year happens.

We could probably reduce the number of times this happens as follows:

  1. Include a simulation length variable in the sim object say N days
  2. At the start of the simulation do mortality calculations for each person for the time period that the simulation is being run. (I.e. say we run for 800 days, floor (800 / 365) = 2 (years). Calculate the probability of dying in the simulation for each person at age A as prob_dying(A) + prob_dying(A+1) to cover probability of death for both years)
  3. Schedule death for some point in the simulation using existing structures
@RobertManningSmith RobertManningSmith added the enhancement New feature or request label Apr 26, 2024
@RobertManningSmith RobertManningSmith self-assigned this Apr 26, 2024
@RobertManningSmith
Copy link
Collaborator Author

On reflection this may not be preferable. If we end up running multi-year simulations, a person's age wouldn't necessarily be accurately considered in their likelihood of death. If we determine mortality at time step 0, and they are on the boundary of an age bracket, this person's aging will not actually come into play when we determine their mortality for multiple stages in the simulation.

Thinking about this, it may be preferable to actually determine each person's mortality on their birthday

@swise5
Copy link
Collaborator

swise5 commented Nov 20, 2024

In the context of multi-year simulations, we could consider a kludge where, for each year, you calculate their probability of mortality and either schedule their death (uniformly, should they be projected to die in the next year) or else age them a year and repeat the process, stopping when either their death is scheduled or they have aged past the duration of the simulation.
However, that kind of pre-calculation isn't...wildly in the spirit of ABM. It assumes away any other health conditions or changes in situation (eg cascading health consequences from infections; movement among locations; changes in family structure). I think it's a good option to keep in mind, should we find the aging process to be destroying our processing speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants