Click or drag to resize

Categorical Class

Discrete Univariate Categorical distribution. For details about this distribution, see Wikipedia - Categorical distribution. This distribution is sometimes called the Discrete distribution.
Inheritance Hierarchy
SystemObject
  Altaxo.Calc.DistributionsCategorical

Namespace: Altaxo.Calc.Distributions
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public class Categorical : IDiscreteDistribution, 
	IUnivariateDistribution, IDistribution

The Categorical type exposes the following members.

Constructors
 NameDescription
Public methodCategorical(Double) Initializes a new instance of the Categorical class.
Public methodCategorical(Histogram) 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.
Public methodCategorical(Double, Random) Initializes a new instance of the Categorical class.
Top
Properties
 NameDescription
Public propertyEntropy Gets the entropy of the distribution.
Public propertyMaximum Gets the largest element in the domain of the distributions which can be represented by an integer.
Public propertyMean Gets the mean of the distribution.
Public propertyMedian Gets the median of the distribution.
Public propertyMinimum Gets the smallest element in the domain of the distributions which can be represented by an integer.
Public propertyMode Gets he mode of the distribution.
Public propertyP Gets the probability mass vector (non-negative ratios) of the multinomial.
Public propertyRandomSource Gets or sets the random number generator which is used to draw random samples.
Public propertySkewness Gets the skewness of the distribution.
Public propertyStdDev Gets the standard deviation of the distribution.
Public propertyVariance Gets the variance of the distribution.
Top
Methods
 NameDescription
Public methodStatic memberCDF Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
Public methodCumulativeDistribution Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodStatic memberInvCDF Computes the inverse of the cumulative distribution function (InvCDF) for the distribution at the given probability.
Public methodStatic memberInvCDFWithCumulativeDistribution Computes the inverse of the cumulative distribution function (InvCDF) for the distribution at the given probability.
Public methodInverseCumulativeDistribution Computes the inverse of the cumulative distribution function (InvCDF) for the distribution at the given probability.
Public methodStatic memberIsValidCumulativeDistribution Checks whether the parameters of the distribution are valid.
Public methodStatic memberIsValidProbabilityMass Checks whether the parameters of the distribution are valid.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodStatic memberPMF Computes the probability mass (PMF) at k, i.e. P(X = k).
Public methodStatic memberPMFLn Computes the log probability mass (lnPMF) at k, i.e. ln(P(X = k)).
Public methodProbability Computes the probability mass (PMF) at k, i.e. P(X = k).
Public methodProbabilityLn Computes the log probability mass (lnPMF) at k, i.e. ln(P(X = k)).
Public methodSample Samples a Binomially distributed random variable.
Public methodStatic memberSample(Double) Samples one categorical distributed random variable; also known as the Discrete distribution.
Public methodStatic memberSample(Random, Double) Samples one categorical distributed random variable; also known as the Discrete distribution.
Public methodSamples Samples an array of Bernoulli distributed random variables.
Public methodStatic memberSamples(Double) Samples a categorically distributed random variable.
Public methodSamples(Int32) Fills an array with samples generated from the distribution.
Public methodStatic memberSamples(Int32, Double) Fills an array with samples generated from the distribution.
Public methodStatic memberSamples(Random, Double) Samples a categorically distributed random variable.
Public methodStatic memberSamples(Random, Int32, Double) Fills an array with samples generated from the distribution.
Public methodStatic memberSamplesWithCumulativeDistribution(Double) Samples a categorically distributed random variable.
Public methodStatic memberSamplesWithCumulativeDistribution(Int32, Double) Fills an array with samples generated from the distribution.
Public methodStatic memberSamplesWithCumulativeDistribution(Random, Double) Samples a categorically distributed random variable.
Public methodStatic memberSamplesWithCumulativeDistribution(Random, Int32, Double) Fills an array with samples generated from the distribution.
Public methodStatic memberSampleWithCumulativeDistribution(Double) Samples one categorical distributed random variable; also known as the Discrete distribution.
Public methodStatic memberSampleWithCumulativeDistribution(Random, Double) Samples one categorical distributed random variable; also known as the Discrete distribution.
Public methodToString A string representation of the distribution.
(Overrides ObjectToString)
Top
Remarks
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.
See Also