WeightedRandom.Backend.WalkerAlias.Preprocess (weighted_random v1.0.0-rc.1)

Copy Markdown View Source

Summary

Functions

Given a list of probabilities, return a tuple with the underweight list, overweight list, and mean.

Returns two lists, the underweight, and the overweight probabilities (preserving their original index)

Functions

prep_numbers(probabilities, tolerance \\ 1.0e-10)

Given a list of probabilities, return a tuple with the underweight list, overweight list, and mean.

split_probabilities(indexed_probabilities, mean, tolerance)

Returns two lists, the underweight, and the overweight probabilities (preserving their original index)