`histogram`. The distribution will not be automatically updated when the histogram changes. The categorical distribution will have one value for each bucket and a probability for that value proportional to the bucket count.

- MathNet.Numerics
- MathNet.Numerics.Differentiation
- MathNet.Numerics.Distributions
- MathNet.Numerics.Financial
- MathNet.Numerics.IntegralTransforms
- MathNet.Numerics.Integration
- MathNet.Numerics.Interpolation
- MathNet.Numerics.LinearAlgebra
- MathNet.Numerics.LinearAlgebra.Complex
- MathNet.Numerics.LinearAlgebra.Complex.Solvers
- MathNet.Numerics.LinearAlgebra.Complex32
- MathNet.Numerics.LinearAlgebra.Complex32.Solvers
- MathNet.Numerics.LinearAlgebra.Double
- MathNet.Numerics.LinearAlgebra.Double.Solvers
- MathNet.Numerics.LinearAlgebra.Factorization
- MathNet.Numerics.LinearAlgebra.Single
- MathNet.Numerics.LinearAlgebra.Single.Solvers
- MathNet.Numerics.LinearAlgebra.Solvers
- MathNet.Numerics.LinearAlgebra.Storage
- MathNet.Numerics.LinearRegression
- MathNet.Numerics.OdeSolvers
- MathNet.Numerics.Optimization
- MathNet.Numerics.Optimization.LineSearch
- MathNet.Numerics.Optimization.ObjectiveFunctions
- MathNet.Numerics.Optimization.TrustRegion
- MathNet.Numerics.Providers.Common.Cuda
- MathNet.Numerics.Providers.Common.Mkl
- MathNet.Numerics.Providers.Common.OpenBlas
- MathNet.Numerics.Providers.FourierTransform
- MathNet.Numerics.Providers.LinearAlgebra
- MathNet.Numerics.Providers.LinearAlgebra.OpenBlas
- MathNet.Numerics.Providers.SparseSolver
- MathNet.Numerics.Random
- MathNet.Numerics.RootFinding
- MathNet.Numerics.Statistics
- MathNet.Numerics.Statistics.Mcmc

- Bernoulli
- Beta
- BetaBinomial
- BetaScaled
- Binomial
- Burr
- Categorical
- Cauchy
- Chi
- ChiSquared
- ContinuousUniform
- ConwayMaxwellPoisson
- Dirichlet
- DiscreteUniform
- Erlang
- Exponential
- FisherSnedecor
- Gamma
- Geometric
- Hypergeometric
- IContinuousDistribution
- IDiscreteDistribution
- IDistribution
- InverseGamma
- InverseGaussian
- InverseWishart
- IUnivariateDistribution
- Laplace
- LogNormal
- MatrixNormal
- MeanPrecisionPair
- Multinomial
- NegativeBinomial
- Normal
- NormalGamma
- Pareto
- Poisson
- Rayleigh
- SkewedGeneralizedError
- SkewedGeneralizedT
- Stable
- StudentT
- Triangular
- TruncatedPareto
- Weibull
- Wishart
- Zipf

Discrete Univariate Categorical distribution.
For details about this distribution, see. This
distribution is sometimes called the Discrete distribution.

The distribution is parameterized by a vector of ratios: in other words, the parameter does not have to be normalized and sum to 1. The reason is that some vectors can't be exactly normalized to sum to 1 in floating point representation.

- CDF
- InvCDF
- InvCDFWithCumulativeDistribution
- IsValidCumulativeDistribution
- IsValidProbabilityMass
- PMF
- PMFLn
- Sample
- Sample
- Samples
- Samples
- Samples
- Samples
- SamplesWithCumulativeDistribution
- SamplesWithCumulativeDistribution
- SamplesWithCumulativeDistribution
- SamplesWithCumulativeDistribution
- SampleWithCumulativeDistribution
- SampleWithCumulativeDistribution

- CumulativeDistribution
- Equals
- GetHashCode
- GetType
- InverseCumulativeDistribution
- Probability
- ProbabilityLn
- Sample
- Samples
- Samples
- ToString

Initializes a new instance of the Categorical class from a `histogram`. The distribution
will not be automatically updated when the histogram changes. The categorical distribution will have
one value for each bucket and a probability for that value proportional to the bucket count.

Initializes a new instance of the Categorical class.
##### Parameters

`Double[]`

probabilityMassAn array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

`Random`

randomSourceThe random number generator which is used to draw random samples.

Initializes a new instance of the Categorical class.
##### Parameters

`Double[]`

probabilityMassAn array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
##### Parameters

##### Return

`Double[]`

probabilityMassAn array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

`double`

xThe location at which to compute the cumulative distribution function.

`double`

the cumulative distribution at location `x`.

Computes the inverse of the cumulative distribution function (InvCDF) for the distribution
at the given probability.
##### Parameters

An array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

##### Return

`Double[]`

probabilityMass`double`

probabilityA real number between 0 and 1.

`int`

An integer between 0 and the size of the categorical (exclusive), that corresponds to the inverse CDF for the given probability.

Computes the inverse of the cumulative distribution function (InvCDF) for the distribution
at the given probability.
##### Parameters

##### Return

`Double[]`

cdfUnnormalizedAn array corresponding to a CDF for a categorical distribution. Not assumed to be normalized.

`double`

probabilityA real number between 0 and 1.

`int`

An integer between 0 and the size of the categorical (exclusive), that corresponds to the inverse CDF for the given probability.

Checks whether the parameters of the distribution are valid.
##### Parameters

An array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

##### Return

`Double[]`

cdf`bool`

If any of the probabilities are negative returns `false`

, or if the sum of parameters is 0.0; otherwise `true`

Checks whether the parameters of the distribution are valid.
##### Parameters

An array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

##### Return

`Double[]`

p`bool`

If any of the probabilities are negative returns `false`

, or if the sum of parameters is 0.0; otherwise `true`

Computes the probability mass (PMF) at k, i.e. P(X = k).
##### Parameters

An array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

##### Return

`Double[]`

probabilityMass`int`

kThe location in the domain where we want to evaluate the probability mass function.

`double`

the probability mass at location `k`.

Computes the log probability mass (lnPMF) at k, i.e. ln(P(X = k)).
##### Parameters

An array of nonnegative ratios: this array does not need to be normalized as this is often impossible using floating point arithmetic.

##### Return

`Double[]`

probabilityMass`int`

kThe location in the domain where we want to evaluate the log probability mass function.

`double`

the log probability mass at location `k`.

Samples one categorical distributed random variable; also known as the Discrete distribution.
##### Parameters

##### Return

`Double[]`

probabilityMassAn array of nonnegative ratios. Not assumed to be normalized.

`int`

One random integer between 0 and the size of the categorical (exclusive).

Samples one categorical distributed random variable; also known as the Discrete distribution.
##### Parameters

##### Return

`Random`

rndThe random number generator to use.

`Double[]`

probabilityMassAn array of nonnegative ratios. Not assumed to be normalized.

`int`

One random integer between 0 and the size of the categorical (exclusive).

Samples a categorically distributed random variable.
##### Parameters

##### Return

`Random`

rndThe random number generator to use.

`Double[]`

probabilityMassAn array of nonnegative ratios. Not assumed to be normalized.

`IEnumerable<int>`

random integers between 0 and the size of the categorical (exclusive).

Samples a categorically distributed random variable.
##### Parameters

##### Return

`Double[]`

probabilityMassAn array of nonnegative ratios. Not assumed to be normalized.

`IEnumerable<int>`

random integers between 0 and the size of the categorical (exclusive).

Fills an array with samples generated from the distribution.
##### Parameters

##### Return

`Random`

rndThe random number generator to use.

`Int32[]`

valuesThe array to fill with the samples.

`Double[]`

probabilityMassAn array of nonnegative ratios. Not assumed to be normalized.

`void`

random integers between 0 and the size of the categorical (exclusive).

Fills an array with samples generated from the distribution.
##### Parameters

##### Return

`Int32[]`

valuesThe array to fill with the samples.

`Double[]`

probabilityMassAn array of nonnegative ratios. Not assumed to be normalized.

`void`

random integers between 0 and the size of the categorical (exclusive).

Samples a categorically distributed random variable.
##### Parameters

##### Return

`Random`

rndThe random number generator to use.

`Double[]`

cdfUnnormalizedAn array of the cumulative distribution. Not assumed to be normalized.

`IEnumerable<int>`

random integers between 0 and the size of the categorical (exclusive).

Fills an array with samples generated from the distribution.
##### Parameters

##### Return

`Random`

rndThe random number generator to use.

`Int32[]`

valuesThe array to fill with the samples.

`Double[]`

cdfUnnormalizedAn array of the cumulative distribution. Not assumed to be normalized.

`void`

random integers between 0 and the size of the categorical (exclusive).

Samples a categorically distributed random variable.
##### Parameters

##### Return

`Double[]`

cdfUnnormalizedAn array of the cumulative distribution. Not assumed to be normalized.

`IEnumerable<int>`

random integers between 0 and the size of the categorical (exclusive).

Fills an array with samples generated from the distribution.
##### Parameters

##### Return

`Int32[]`

valuesThe array to fill with the samples.

`Double[]`

cdfUnnormalizedAn array of the cumulative distribution. Not assumed to be normalized.

`void`

random integers between 0 and the size of the categorical (exclusive).

Samples one categorical distributed random variable; also known as the Discrete distribution.
##### Parameters

##### Return

`Random`

rndThe random number generator to use.

`Double[]`

cdfUnnormalizedAn array of the cumulative distribution. Not assumed to be normalized.

`int`

One random integer between 0 and the size of the categorical (exclusive).

Samples one categorical distributed random variable; also known as the Discrete distribution.
##### Parameters

##### Return

`Double[]`

cdfUnnormalizedAn array of the cumulative distribution. Not assumed to be normalized.

`int`

One random integer between 0 and the size of the categorical (exclusive).

Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
##### Parameters

##### Return

`double`

xThe location at which to compute the cumulative distribution function.

`double`

the cumulative distribution at location `x`.

Computes the inverse of the cumulative distribution function (InvCDF) for the distribution
at the given probability.
##### Parameters

##### Return

`double`

probabilityA real number between 0 and 1.

`int`

An integer between 0 and the size of the categorical (exclusive), that corresponds to the inverse CDF for the given probability.

Computes the probability mass (PMF) at k, i.e. P(X = k).
##### Parameters

##### Return

`int`

kThe location in the domain where we want to evaluate the probability mass function.

`double`

the probability mass at location `k`.

Computes the log probability mass (lnPMF) at k, i.e. ln(P(X = k)).
##### Parameters

##### Return

`int`

kThe location in the domain where we want to evaluate the log probability mass function.

`double`

the log probability mass at location `k`.

Samples a Binomially distributed random variable.
##### Return

`int`

The number of successful trials.

Samples an array of Bernoulli distributed random variables.
##### Return

`IEnumerable<int>`

a sequence of successful trial counts.

Fills an array with samples generated from the distribution.

A string representation of the distribution.
##### Return

`string`

a string representation of the distribution.

Gets the entropy of the distribution.

Gets the largest element in the domain of the distributions which can be represented by an integer.

Gets the mean of the distribution.

Gets the median of the distribution.

Gets the smallest element in the domain of the distributions which can be represented by an integer.

Gets he mode of the distribution.

Throws a NotSupportedException.

Gets the probability mass vector (non-negative ratios) of the multinomial.

Sometimes the normalized probability vector cannot be represented exactly in a floating point representation.

Gets or sets the random number generator which is used to draw random samples.

Gets the skewness of the distribution.

Throws a NotSupportedException.

Gets the standard deviation of the distribution.

Gets the variance of the distribution.