Skip to content

Defined in: packages/distribution/src/distribution.ts:43

A distribution assigning probability masses to individual outcomes.

K extends string = string

P extends object = object

readonly kind: K

Defined in: packages/distribution/src/distribution.ts:13

The serializable name of the family.

CumulativeDistribution.kind


readonly parameters: Readonly<P>

Defined in: packages/distribution/src/distribution.ts:15

The captured input parameters.

CumulativeDistribution.parameters


readonly support: DistributionSupport

Defined in: packages/distribution/src/distribution.ts:17

The closed bounds of the represented outcomes.

CumulativeDistribution.support


readonly cumulativeProbability: (x) => Probability

Defined in: packages/distribution/src/distribution.ts:22

The probability of an outcome at or below x.

number

Probability

With INVALID_ARGUMENT when x is NaN or not a number.

CumulativeDistribution.cumulativeProbability


readonly survivalProbability: (x) => Probability

Defined in: packages/distribution/src/distribution.ts:27

The probability of an outcome strictly above x.

number

Probability

With INVALID_ARGUMENT when x is NaN or not a number.

CumulativeDistribution.survivalProbability


readonly quantile: (p) => number

Defined in: packages/distribution/src/distribution.ts:32

The first support value whose cumulative probability reaches p. At 0 and 1, returns the support endpoints.

Probability

number

With INVALID_PROBABILITY when p is outside [0, 1] or is NaN.

CumulativeDistribution.quantile


readonly draw: (random) => number

Defined in: packages/distribution/src/distribution.ts:39

Draw one value from the supplied source. There is no state between draws besides the caller’s source. The same seed replays on the same engine build and platform. One differing comparison or rounding on another engine can change that draw and every later one, including how many words a rejection sampler consumes.

RandomSource

number

With INVALID_SOURCE_VALUE for an invalid value from the source.

CumulativeDistribution.draw


readonly probability: (x) => Probability

Defined in: packages/distribution/src/distribution.ts:51

The probability of the outcome x, or 0 if x is absent from the support.

number

Probability

With INVALID_ARGUMENT when x is NaN or not a number.


readonly logProbability: (x) => number

Defined in: packages/distribution/src/distribution.ts:56

The natural logarithm of the probability of x, with -Infinity for zero mass.

number

number

With INVALID_ARGUMENT when x is NaN or not a number.