Skip to main content
The Deno 2 Release Candidate is here
Learn more
method ProbabilityObjectArray.prototype.cumulativeProbability
import { ProbabilityObjectArray } from "https://deno.land/x/sptaki@1.2.0/utils/RandomUtil.d.ts";

Calculates the normalized cumulative probability of the ProbabilityObjectArray's elements normalized to 1

Parameters

probValues: number[]

The relative probability values of which to calculate the normalized cumulative sum

Returns

number[]

Cumulative Sum normalized to 1