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
@spec prep_numbers( WeightedRandom.Utils.Types.probabilities(), WeightedRandom.Utils.Types.tolerance() ) :: {WeightedRandom.Utils.Types.indexed_probabilities(), WeightedRandom.Utils.Types.indexed_probabilities(), float()}
Given a list of probabilities, return a tuple with the underweight list, overweight list, and mean.
@spec split_probabilities( WeightedRandom.Utils.Types.indexed_probabilities(), mean :: float(), WeightedRandom.Utils.Types.tolerance() ) :: {lower :: WeightedRandom.Utils.Types.indexed_probabilities(), higher :: WeightedRandom.Utils.Types.indexed_probabilities()}
Returns two lists, the underweight, and the overweight probabilities (preserving their original index)