## Types in MathNet.Numerics.Statistics

Type Statistics

Namespace MathNet.Numerics.Statistics

Extension methods to return basic statistics on set of data.

### Public Static Functions

#### doubleCovariance(this IEnumerable<double> samples1, IEnumerable<double> samples2)

Estimates the unbiased population covariance from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN if data has less than two entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples1

A subset of samples, sampled from the full population.

###### `IEnumerable<double>` samples2

A subset of samples, sampled from the full population.

#### doubleEmpiricalCDF(this IEnumerable<float> data, float x)

Estimates the empirical cumulative distribution function (CDF) at x from the provided samples.
##### Parameters
###### `IEnumerable<float>` data

The data sample sequence.

###### `float` x

The value where to estimate the CDF at.

#### doubleEmpiricalCDF(this IEnumerable<double> data, double x)

Estimates the empirical cumulative distribution function (CDF) at x from the provided samples.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `double` x

The value where to estimate the CDF at.

#### Func<double, double>EmpiricalCDFFunc(this IEnumerable<double> data)

Estimates the empirical cumulative distribution function (CDF) at x from the provided samples.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleEmpiricalInvCDF(this IEnumerable<double> data, double tau)

Estimates the empirical inverse CDF at tau from the provided samples.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `double` tau

Quantile selector, between 0.0 and 1.0 (inclusive).

#### Func<double, double>EmpiricalInvCDFFunc(this IEnumerable<double> data)

Estimates the empirical inverse CDF at tau from the provided samples.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleEntropy(IEnumerable<double> data)

Calculates the entropy of a stream of double values in bits. Returns NaN if any of the values in the stream are NaN.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### Double[]FiveNumberSummary(this IEnumerable<double> data)

Estimates {min, lower-quantile, median, upper-quantile, max} from the provided samples. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleGeometricMean(this IEnumerable<double> data)

Evaluates the geometric mean. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` data

The data to calculate the geometric mean of.

##### Return
###### `double`

The geometric mean of the sample.

#### doubleHarmonicMean(this IEnumerable<double> data)

Evaluates the harmonic mean. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` data

The data to calculate the harmonic mean of.

##### Return
###### `double`

The harmonic mean of the sample.

#### doubleInterquartileRange(this IEnumerable<double> data)

Estimates the inter-quartile range from the provided samples. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleKurtosis(this IEnumerable<double> samples)

Estimates the unbiased population kurtosis from the provided samples. Uses a normalizer (Bessel's correction; type 2). Returns NaN if data has less than four entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

A subset of samples, sampled from the full population.

#### doubleLowerQuartile(this IEnumerable<double> data)

Estimates the first quartile value from the provided samples. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleMaximum(this IEnumerable<double> data)

Returns the maximum value in the sample data. Returns NaN if data is empty or if any entry is NaN.

The sample data.

##### Return
###### `double`

The maximum value in the sample data.

#### doubleMaximumAbsolute(this IEnumerable<double> data)

Returns the maximum absolute value in the sample data. Returns NaN if data is empty or if any entry is NaN.

The sample data.

##### Return
###### `double`

The maximum value in the sample data.

#### ComplexMaximumMagnitudePhase(this IEnumerable<Complex> data)

Returns the maximum magnitude and phase value in the sample data. Returns NaN if data is empty or if any entry is NaN.

The sample data.

##### Return
###### `Complex`

The minimum value in the sample data.

#### doubleMean(this IEnumerable<double> data)

Evaluates the sample mean, an estimate of the population mean. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` data

The data to calculate the mean of.

##### Return
###### `double`

The mean of the sample.

#### ValueTuple<double, double>MeanStandardDeviation(this IEnumerable<double> samples)

Estimates the sample mean and the unbiased population standard deviation from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or if any entry is NaN and NaN for standard deviation if data has less than two entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

The data to calculate the mean of.

##### Return
###### `ValueTuple<double, double>`

The mean of the sample.

#### ValueTuple<double, double>MeanVariance(this IEnumerable<double> samples)

Estimates the sample mean and the unbiased population variance from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or if any entry is NaN and NaN for variance if data has less than two entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

The data to calculate the mean of.

##### Return
###### `ValueTuple<double, double>`

The mean of the sample.

#### doubleMedian(this IEnumerable<double> data)

Estimates the sample median from the provided samples (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleMinimum(this IEnumerable<double> data)

Returns the minimum value in the sample data. Returns NaN if data is empty or if any entry is NaN.

The sample data.

##### Return
###### `double`

The minimum value in the sample data.

#### doubleMinimumAbsolute(this IEnumerable<double> data)

Returns the minimum absolute value in the sample data. Returns NaN if data is empty or if any entry is NaN.

The sample data.

##### Return
###### `double`

The minimum value in the sample data.

#### ComplexMinimumMagnitudePhase(this IEnumerable<Complex> data)

Returns the minimum magnitude and phase value in the sample data. Returns NaN if data is empty or if any entry is NaN.

The sample data.

##### Return
###### `Complex`

The minimum value in the sample data.

#### IEnumerable<double>MovingAverage(this IEnumerable<double> samples, int windowSize)

Evaluates the sample mean over a moving window, for each samples. Returns NaN if no data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

The sample stream to calculate the mean of.

###### `int` windowSize

The number of last samples to consider.

#### doubleOrderStatistic(IEnumerable<double> data, int order)

Returns the order statistic (order 1..N) from the provided samples.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `int` order

One-based order of the statistic, must be between 1 and N (inclusive).

#### Func<int, double>OrderStatisticFunc(IEnumerable<double> data)

Returns the order statistic (order 1..N) from the provided samples.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doublePercentile(this IEnumerable<double> data, int p)

Estimates the p-Percentile value from the provided samples. If a non-integer Percentile is needed, use Quantile instead. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `int` p

Percentile selector, between 0 and 100 (inclusive).

#### Func<int, double>PercentileFunc(this IEnumerable<double> data)

Estimates the p-Percentile value from the provided samples. If a non-integer Percentile is needed, use Quantile instead. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doublePopulationCovariance(this IEnumerable<double> population1, IEnumerable<double> population2)

Evaluates the population covariance from the provided full populations. On a dataset of size N will use an N normalizer and would thus be biased if applied to a subset. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` population1

The full population data.

###### `IEnumerable<double>` population2

The full population data.

#### doublePopulationKurtosis(this IEnumerable<double> population)

Evaluates the kurtosis from the full population. Does not use a normalizer and would thus be biased if applied to a subset (type 1). Returns NaN if data has less than three entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` population

The full population data.

#### doublePopulationSkewness(this IEnumerable<double> population)

Evaluates the skewness from the full population. Does not use a normalizer and would thus be biased if applied to a subset (type 1). Returns NaN if data has less than two entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` population

The full population data.

#### ValueTuple<double, double>PopulationSkewnessKurtosis(this IEnumerable<double> population)

Evaluates the skewness and kurtosis from the full population. Does not use a normalizer and would thus be biased if applied to a subset (type 1).
##### Parameters
###### `IEnumerable<double>` population

The full population data.

#### doublePopulationStandardDeviation(this IEnumerable<double> population)

Evaluates the standard deviation from the provided full population. On a dataset of size N will use an N normalizer and would thus be biased if applied to a subset. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` population

The full population data.

#### doublePopulationVariance(this IEnumerable<double> population)

Evaluates the variance from the provided full population. On a dataset of size N will use an N normalizer and would thus be biased if applied to a subset. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` population

The full population data.

#### doubleQuantile(this IEnumerable<double> data, double tau)

Estimates the tau-th quantile from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `double` tau

Quantile selector, between 0.0 and 1.0 (inclusive).

#### doubleQuantileCustom(this IEnumerable<double> data, double tau, QuantileDefinition definition)

Estimates the tau-th quantile from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile definition can be specified to be compatible with an existing system.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `double` tau

Quantile selector, between 0.0 and 1.0 (inclusive).

###### `QuantileDefinition` definition

Quantile definition, to choose what product/definition it should be consistent with

#### Func<double, double>QuantileCustomFunc(this IEnumerable<double> data, QuantileDefinition definition)

Estimates the tau-th quantile from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile definition can be specified to be compatible with an existing system.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `QuantileDefinition` definition

Quantile definition, to choose what product/definition it should be consistent with

#### Func<double, double>QuantileFunc(this IEnumerable<double> data)

Estimates the tau-th quantile from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleQuantileRank(this IEnumerable<double> data, double x, RankDefinition definition)

Estimates the quantile tau from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile definition can be specified to be compatible with an existing system.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

Quantile value.

###### `RankDefinition` definition

Rank definition, to choose how ties should be handled and what product/definition it should be consistent with

#### doubleQuantileRank(this IEnumerable<float> data, float x, RankDefinition definition)

Estimates the quantile tau from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile definition can be specified to be compatible with an existing system.
##### Parameters
###### `IEnumerable<float>` data

The data sample sequence.

Quantile value.

###### `RankDefinition` definition

Rank definition, to choose how ties should be handled and what product/definition it should be consistent with

#### Func<double, double>QuantileRankFunc(this IEnumerable<double> data, RankDefinition definition)

Estimates the quantile tau from the provided samples. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile definition can be specified to be compatible with an existing system.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `RankDefinition` definition

Rank definition, to choose how ties should be handled and what product/definition it should be consistent with

#### Double[]Ranks(this IEnumerable<double> data, RankDefinition definition)

Evaluates the rank of each entry of the provided samples. The rank definition can be specified to be compatible with an existing system.
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

###### `RankDefinition` definition

Rank definition, to choose how ties should be handled and what product/definition it should be consistent with

#### doubleRootMeanSquare(this IEnumerable<double> data)

Evaluates the root mean square (RMS) also known as quadratic mean. Returns NaN if data is empty or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` data

The data to calculate the RMS of.

#### doubleSkewness(this IEnumerable<double> samples)

Estimates the unbiased population skewness from the provided samples. Uses a normalizer (Bessel's correction; type 2). Returns NaN if data has less than three entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

A subset of samples, sampled from the full population.

#### ValueTuple<double, double>SkewnessKurtosis(this IEnumerable<double> samples)

Estimates the unbiased population skewness and kurtosis from the provided samples in a single pass. Uses a normalizer (Bessel's correction; type 2).
##### Parameters
###### `IEnumerable<double>` samples

A subset of samples, sampled from the full population.

#### doubleStandardDeviation(this IEnumerable<double> samples)

Estimates the unbiased population standard deviation from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN if data has less than two entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

A subset of samples, sampled from the full population.

#### doubleUpperQuartile(this IEnumerable<double> data)

Estimates the third quartile value from the provided samples. Approximately median-unbiased regardless of the sample distribution (R8).
##### Parameters
###### `IEnumerable<double>` data

The data sample sequence.

#### doubleVariance(this IEnumerable<double> samples)

Estimates the unbiased population variance from the provided samples. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN if data has less than two entries or if any entry is NaN.
##### Parameters
###### `IEnumerable<double>` samples

A subset of samples, sampled from the full population.