Skip to content

isProbabilityVector(values): values is ArrayLike<Probability>

Defined in: packages/distribution/src/probability-vector.ts:16

Whether every entry is a probability and the compensated total lies within PROBABILITY_TABLE_SUM_TOLERANCE of one. This is the rule probabilityTableDistribution applies to its masses, without building a distribution. A caller that rejects a vector throws its own error. Takes linear time and constant space.

ArrayLike<number>

values is ArrayLike<Probability>