Types in MathNet.Numerics.Distributions

Type Hypergeometric

Namespace MathNet.Numerics.Distributions

Interfaces IDiscreteDistribution

Discrete Univariate Hypergeometric distribution. This distribution is a discrete probability distribution that describes the number of successes in a sequence of n draws from a finite population without replacement, just as the binomial distribution describes the number of successes for draws with replacement.

Public Constructors

Hypergeometric(int population, int success, int draws, Random randomSource)

Initializes a new instance of the Hypergeometric class.
Parameters
`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

`Random` randomSource

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

Hypergeometric(int population, int success, int draws)

Initializes a new instance of the Hypergeometric class.
Parameters
`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

Public Static Functions

doubleCDF(int population, int success, int draws, double x)

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

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

`double` x

The location at which to compute the cumulative distribution function.

Return
`double`

the cumulative distribution at location x.

boolIsValidParameterSet(int population, int success, int draws)

Tests whether the provided values are valid parameters for this distribution.
Parameters
`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

doublePMF(int population, int success, int draws, int k)

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

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

`int` k

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

Return
`double`

the probability mass at location k.

doublePMFLn(int population, int success, int draws, int k)

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

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

`int` k

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

Return
`double`

the log probability mass at location k.

intSample(Random rnd, int population, int success, int draws)

Samples a random variable.
Parameters
`Random` rnd

The random number generator to use.

`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

intSample(int population, int success, int draws)

Samples a random variable.
Parameters
`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

voidSamples(Int32[] values, int population, int success, int draws)

Fills an array with samples generated from the distribution.
Parameters
`Int32[]` values

The array to fill with the samples.

`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

voidSamples(Random rnd, Int32[] values, int population, int success, int draws)

Fills an array with samples generated from the distribution.
Parameters
`Random` rnd

The random number generator to use.

`Int32[]` values

The array to fill with the samples.

`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

IEnumerable<int>Samples(Random rnd, int population, int success, int draws)

Samples a sequence of this random variable.
Parameters
`Random` rnd

The random number generator to use.

`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

IEnumerable<int>Samples(int population, int success, int draws)

Samples a sequence of this random variable.
Parameters
`int` population

The size of the population (N).

`int` success

The number successes within the population (K, M).

`int` draws

The number of draws without replacement (n).

Public Methods

doubleCumulativeDistribution(double x)

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

The location at which to compute the cumulative distribution function.

Return
`double`

the cumulative distribution at location x.

doubleProbability(int k)

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

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

Return
`double`

the probability mass at location k.

doubleProbabilityLn(int k)

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

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

Return
`double`

the log probability mass at location k.

intSample()

Samples a Hypergeometric distributed random variable.
Return
`int`

The number of successes in n trials.

IEnumerable<int>Samples()

Samples an array of Hypergeometric distributed random variables.
Return
`IEnumerable<int>`

a sequence of successes in n trials.

voidSamples(Int32[] values)

Fills an array with samples generated from the distribution.

stringToString()

Returns a String that represents this instance.
Return
`string`

A String that represents this instance.

Public Properties

intDraws get;

Gets the number of draws without replacement (n).

doubleEntropy get;

Gets the entropy of the distribution.

intMaximum get;

Gets the maximum of the distribution.

doubleMean get;

Gets the mean of the distribution.

doubleMedian get;

Gets the median of the distribution.

intMinimum get;

Gets the minimum of the distribution.

intMode get;

Gets the mode of the distribution.

intPopulation get;

Gets the size of the population (N).

RandomRandomSource get; set;

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

doubleSkewness get;

Gets the skewness of the distribution.

doubleStdDev get;

Gets the standard deviation of the distribution.

intSuccess get;

Gets the number successes within the population (K, M).

doubleVariance get;

Gets the variance of the distribution.