Skip to content

customDiscreteDistribution(parameters): CustomDiscreteDistribution

Defined in: packages/distribution/src/custom-discrete-distribution.ts:32

Build a distribution over integer outcomes. Infinite upper support requires the cumulative callback. Finite tails sum the supplied masses on their own side. Infinite survival uses the complement of the CDF.

Draws consume two 32-bit words and replay only when the callbacks are deterministic.

CustomDiscreteDistributionParameters

CustomDiscreteDistribution

With INVALID_PARAMETER for invalid bounds or missing callbacks. Calls to the returned distribution throw INVALID_CALLBACK_VALUE when a consumed callback result is outside [0, 1].