Generate random seeds in dataset for reproducible stochastic simulations#202
Closed
MaxGhenis wants to merge 1 commit into
Closed
Generate random seeds in dataset for reproducible stochastic simulations#202MaxGhenis wants to merge 1 commit into
MaxGhenis wants to merge 1 commit into
Conversation
This change moves random number generation from policyengine-uk into the dataset generation, following the pattern established in policyengine-us-data. Changes: - Add random seed generation in FRS dataset for person, benunit, and household entities - Update SPI dataset to use seeded generator for age assignment - Update income imputation to use seeded generator for age assignment - Update capital gains imputation to use seeded generator for quantile sampling - Update childcare assumptions to use seeded generator All random generation now uses np.random.default_rng(seed=100) for full reproducibility across dataset builds. This replaces the previous approach of calculating random variables directly during simulation and instead stores random seeds in the dataset that can be used by variables in policyengine-uk. Related: policyengine-uk PR (must be merged after this)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR moves random number generation from policyengine-uk into the dataset generation, following the pattern established in policyengine-us-data.
Changes
All random generation now uses
np.random.default_rng(seed=100)for full reproducibility across dataset builds.This replaces the previous approach of calculating random variables directly during simulation and instead stores random seeds in the dataset that can be used by variables in policyengine-uk.
Related PRs
Test Plan
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com