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

Feature/common random #27

Merged
merged 6 commits into from
Nov 9, 2023
Merged

Feature/common random #27

merged 6 commits into from
Nov 9, 2023

Conversation

adolgert
Copy link
Owner

@adolgert adolgert commented Nov 9, 2023

This adds one way to implement Common Random Numbers (CRN). This is a method for reducing the number of draws required in order to get good statistical power on an estimate of the effect of changes to parameters in a simulation. The idea is to run a simulation once, recording its randomness, then for each modification of the parameters, run the simulation with the same underlying randomness. This will destroy any measurements of the dispersion of trajectories, but it will tell you centrality measures with many fewer draws.

This implementation records the state of the random number generator before each and every enabling of a distribution. That would be crazy to do with a Mersenne twister random number generator because its state is large, but a Xoshiro generator has 32 bytes. This is still large, but is manageable. The advantage to this, over recording draws from uniform numbers, is that it lets the sampler use the fastest available methods to sample distributions. Disadvantages are that it needs more memory.

@adolgert adolgert merged commit 3b99663 into main Nov 9, 2023
7 checks passed
@adolgert adolgert deleted the feature/common-random branch November 9, 2023 12:16
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.

1 participant