Skip to content

refactor(binomial-distribution): replace batch sampler with Walker's alias table#150

Merged
JimmyMAndersson merged 1 commit into
mainfrom
refactor/binomial-distribution-sampling
May 9, 2026
Merged

refactor(binomial-distribution): replace batch sampler with Walker's alias table#150
JimmyMAndersson merged 1 commit into
mainfrom
refactor/binomial-distribution-sampling

Conversation

@JimmyMAndersson

Copy link
Copy Markdown
Owner

Use the alias method for O(1) sampling per draw when generating large batches, replacing the previous O(n) linear CDF search. The alias table is built once from PMF weights and amortises the construction cost across all requested samples.

Fixes #149

@JimmyMAndersson JimmyMAndersson self-assigned this May 9, 2026
…alias table

Use the alias method for O(1) sampling per draw when generating large
batches, replacing the previous O(n) linear CDF search. The alias
table is built once from PMF weights and amortises the construction
cost across all requested samples.

Fixes #149
@JimmyMAndersson JimmyMAndersson force-pushed the refactor/binomial-distribution-sampling branch from 2ca665d to d02d6a9 Compare May 9, 2026 10:15
@JimmyMAndersson JimmyMAndersson merged commit 245b1bf into main May 9, 2026
5 checks passed
@JimmyMAndersson JimmyMAndersson deleted the refactor/binomial-distribution-sampling branch May 9, 2026 10: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.

Improve Binomial Distribution Sampling

1 participant