Skip to content

totalVariationDistance(first, second): number

Defined in: packages/distance/src/total-variation.ts:10

Largest absolute difference in event probability for two probability vectors on the same ordered outcomes. Accepted vectors are normalized by their totals. Returns a distance in [0, 1] in O(n) time and O(1) extra space.

NumericVector

NumericVector

number

With INVALID_DIMENSION or INVALID_PROBABILITIES.