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

Draw expected lifespans at start of simulation for consistency #18

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sandypreiss
Copy link
Collaborator

In some recent experiments, we want to quantify life years saved as mean_lifespan_implementation - mean_lifespan_baseline. Other than initial compliance rate, the baseline and implementation scenarios use the same parameters. For a given iteration, which uses the same seed, we want life expectancy to be exactly the same, but it’s not.

This is due to the way we use the random number generator. We simulate each person one at a time, and we may need to draw a different number of random numbers for each person depending on the other parameters. So by the time we get to the next person’s life expectancy draw, the random number generator can be in a different state.

These random differences are fairly large, relative to the effect sizes of the initial compliance rate differences. This throws off the life years saved calculation.

This PR implements a fix by drawing expected lifespans at the start of the simulation.

In draft for now, because this still needs to be tested with an experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant