DiscreteDistribution

References
[IoId("00000000-35D9-4AC9-B5EA-A9AA2235396A")] public struct DiscreteDistribution : IStorable
Represents a variety of discrete statistical distributions.

Constructors

DiscreteDistribution

#
public DiscreteDistribution(IReader reader)
reader (IReader)

Properties

Deviation

#
public double Deviation { get; }
Gets the standard deviation of this distribution. Not all types of distribution have a meaningful deviation, in which case this property returns NaN.

Entropy

#
public double Entropy { get; }
Gets the entropy of this distribution. Not all types of distribution have an entropy value, in which case this property returns NaN.

Maximum

#
public int Maximum { get; }
Gets the largest parameter for which this distribution is defined.

Mean

#
public double Mean { get; }
Gets the mean of this distribution. Not all types of distribution have a mean, in which case this property returns NaN.

Median

#
public double Median { get; }
Gets the median of this distribution. Not all types of distribution have a median, in which case this property returns NaN.

Minimum

#
public int Minimum { get; }
Gets the smallest parameter for which this distribution is defined.

Mode

#
public int Mode { get; }
Gets the mode of this distribution. Not all types of distribution have a mode, in which case this property returns NaN.

Skewness

#
public double Skewness { get; }
Gets the statistical skewness of this distribution. Not all types of distribution have a skewness, in which case this property returns NaN.

Type

#
public DistributionType Type { get; }
Gets the type of this distribution.

Variance

#
public double Variance { get; }
Gets the statistical variance of this distribution. Not all types of distribution have a variance, in which case this property returns NaN.

Methods

CreateBernoulli

#
public static DiscreteDistribution CreateBernoulli(double p)
Create a Bernoulli discrete distribution.
p (double)Chance of success (0, 1).

CreateBinomial

#
public static DiscreteDistribution CreateBinomial(double p, int n)
Create a Binomial discrete distribution.
p (double)
n (int)

CreateConwayMaxwell

#
public static DiscreteDistribution CreateConwayMaxwell(double lambda, double nu)
Create a Conway-Maxwell-Poisson discrete distribution.
lambda (double)
nu (double)

CreateGeometric

#
public static DiscreteDistribution CreateGeometric(double p)
Create a Geometric discrete distribution.
p (double)

CreateHyperGeometric

#
public static DiscreteDistribution CreateHyperGeometric(int population, int success, int draws)
Create a Hyper-Geometric discrete distribution.
population (int)
success (int)
draws (int)

CreatePoisson

#
public static DiscreteDistribution CreatePoisson(double lambda)
Create a Poisson discrete distribution.
lambda (double)

CreateSampling

#
public int[] CreateSampling(Random random, int count)
Gets a collection of random samples within this distribution. This method should only be called when the distribution is discrete.
random (Random)Random engine.
count (int)Number of samples.
Array of samples.

CreateSamplingConsistent

#
public int[] CreateSamplingConsistent(RandomEngine engine, int count)
Create a random sampling of this distribution which is more consistent but slower than the CreateSampling(Random, int) method.
engine (RandomEngine)Random engine to use.
count (int)Number of samples to create.

CreateUniform

#
public static DiscreteDistribution CreateUniform(int minimum, int maximum)
Create a uniform discrete distribution.
minimum (int)Start of distribution (inclusive).
maximum (int)End of distribution (includive).

CreateZipf

#
public static DiscreteDistribution CreateZipf(double shape, int n)
Create a Zipf discrete distribution.
shape (double)
n (int)

CumulativeAt

#
public double CumulativeAt(double x)
Gets the cumulative distribution at x.
x (double)Parameter.
Cumulative probability at x.

GetPreview

#
public void GetPreview(out int[] i, out double[] pdf, out double[] cdf)
Create a preview of the PDF and CDF functions.
i (out int[])Sample indices.
pdf (out double[])Value of the PDF at every sample.
cdf (out double[])Value of the CDF at every sample.

GetRelevantInterval

#
public (int i0, int i1) GetRelevantInterval()
Gets the relevant x-interval in which the distribution has the most detailed progression. This method is used to decide on which interval any distribution previews ought to be drawn.

ProbabilityAt

#
public double ProbabilityAt(int i)
Gets the probability density of the distribution at index i.
i (int)Parameter.
Probability density at i.

Store

#
public void Store(IWriter writer)
writer (IWriter)
Store

ToString

#
public override string ToString()

ValidateConwayMaxwellNuParameter

#
public static double ValidateConwayMaxwellNuParameter(double lambda, double nu)
lambda (double)
nu (double)