# CumulativeDistribution

Defined in: [packages/distribution/src/distribution.ts:11](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L11)

The shared operations of discrete and continuous distributions.

## Extended by

* [`ContinuousDistribution`](/reference/knotkit/distribution/interfaces/continuousdistribution/)
* [`DiscreteDistribution`](/reference/knotkit/distribution/interfaces/discretedistribution/)

## Type Parameters

### K

`K` *extends* `string` = `string`

### P

`P` *extends* `object` = `object`

## Properties

### kind

> `readonly` **kind**: `K`

Defined in: [packages/distribution/src/distribution.ts:13](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L13)

The serializable name of the family.

***

### parameters

> `readonly` **parameters**: `Readonly`<`P`>

Defined in: [packages/distribution/src/distribution.ts:15](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L15)

The captured input parameters.

***

### support

> `readonly` **support**: [`DistributionSupport`](/reference/knotkit/distribution/interfaces/distributionsupport/)

Defined in: [packages/distribution/src/distribution.ts:17](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L17)

The closed bounds of the represented outcomes.

***

### cumulativeProbability

> `readonly` **cumulativeProbability**: (`x`) => [`Probability`](/reference/knotkit/distribution/type-aliases/probability/)

Defined in: [packages/distribution/src/distribution.ts:22](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L22)

The probability of an outcome at or below `x`.

#### Parameters

##### x

`number`

#### Returns

[`Probability`](/reference/knotkit/distribution/type-aliases/probability/)

#### Throws

With `INVALID_ARGUMENT` when `x` is `NaN` or not a number.

***

### survivalProbability

> `readonly` **survivalProbability**: (`x`) => [`Probability`](/reference/knotkit/distribution/type-aliases/probability/)

Defined in: [packages/distribution/src/distribution.ts:27](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L27)

The probability of an outcome strictly above `x`.

#### Parameters

##### x

`number`

#### Returns

[`Probability`](/reference/knotkit/distribution/type-aliases/probability/)

#### Throws

With `INVALID_ARGUMENT` when `x` is `NaN` or not a number.

***

### quantile

> `readonly` **quantile**: (`p`) => `number`

Defined in: [packages/distribution/src/distribution.ts:32](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L32)

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

#### Parameters

##### p

[`Probability`](/reference/knotkit/distribution/type-aliases/probability/)

#### Returns

`number`

#### Throws

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

***

### draw

> `readonly` **draw**: (`random`) => `number`

Defined in: [packages/distribution/src/distribution.ts:39](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/distribution/src/distribution.ts#L39)

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.

#### Parameters

##### random

[`RandomSource`](/reference/knotkit/prng/type-aliases/randomsource/)

#### Returns

`number`

#### Throws

With `INVALID_SOURCE_VALUE` for an invalid value from the source.
