Namespaces

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.

Constructors

Static Functions

Methods

Properties

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

double CDF(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.

bool IsValidParameterSet(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).

double PMF(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.

double PMFLn(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.

int Sample(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).

int Sample(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).

void Samples(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).

void Samples(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

double CumulativeDistribution(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.

bool Equals(object obj)

int GetHashCode()

Type GetType()

double Probability(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.

double ProbabilityLn(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.

int Sample()

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.

void Samples(Int32[] values)

Fills an array with samples generated from the distribution.

string ToString()

Returns a String that represents this instance.
Return
string

A String that represents this instance.

Public Properties

int Draws get;

Gets the number of draws without replacement (n).

double Entropy get;

Gets the entropy of the distribution.

int Maximum get;

Gets the maximum of the distribution.

double Mean get;

Gets the mean of the distribution.

double Median get;

Gets the median of the distribution.

int Minimum get;

Gets the minimum of the distribution.

int Mode get;

Gets the mode of the distribution.

int Population get;

Gets the size of the population (N).

Random RandomSource get; set;

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

double Skewness get;

Gets the skewness of the distribution.

double StdDev get;

Gets the standard deviation of the distribution.

int Success get;

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

double Variance get;

Gets the variance of the distribution.