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.
Parameters
Section titled “Parameters”second
Section titled “second”Returns
Section titled “Returns”number
Throws
Section titled “Throws”With INVALID_DIMENSION or INVALID_PROBABILITIES.