Namespaces

Types in MathNet.Numerics.Statistics

Type ArrayStatistics

Namespace MathNet.Numerics.Statistics

Statistics operating on arrays assumed to be unsorted. WARNING: Methods with the Inplace-suffix may modify the data array by reordering its entries.

Static Functions

Public Static Functions

double Covariance(Int32[] samples1, Int32[] samples2)

Estimates the unbiased population covariance from the provided two sample arrays. 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
Int32[] samples1

First sample array.

Int32[] samples2

Second sample array.

double Covariance(Single[] samples1, Single[] samples2)

Estimates the unbiased population covariance from the provided two sample arrays. 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
Single[] samples1

First sample array.

Single[] samples2

Second sample array.

double Covariance(Double[] samples1, Double[] samples2)

Estimates the unbiased population covariance from the provided two sample arrays. 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
Double[] samples1

First sample array.

Double[] samples2

Second sample array.

Double[] FiveNumberSummaryInplace(Double[] data)

Estimates {min, lower-quantile, median, upper-quantile, max} from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

Single[] FiveNumberSummaryInplace(Single[] data)

Estimates {min, lower-quantile, median, upper-quantile, max} from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double GeometricMean(Int32[] data)

Evaluates the geometric mean of the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Int32[] data

Sample array, no sorting is assumed.

double GeometricMean(Double[] data)

Evaluates the geometric mean of the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

double GeometricMean(Single[] data)

Evaluates the geometric mean of the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

double HarmonicMean(Double[] data)

Evaluates the harmonic mean of the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

double HarmonicMean(Int32[] data)

Evaluates the harmonic mean of the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Int32[] data

Sample array, no sorting is assumed.

double HarmonicMean(Single[] data)

Evaluates the harmonic mean of the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

float InterquartileRangeInplace(Single[] data)

Estimates the inter-quartile range from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double InterquartileRangeInplace(Double[] data)

Estimates the inter-quartile range from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

float LowerQuartileInplace(Single[] data)

Estimates the first quartile value from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double LowerQuartileInplace(Double[] data)

Estimates the first quartile value from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

double Maximum(Double[] data)

Returns the largest value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

float Maximum(Single[] data)

Returns the smallest value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

double MaximumAbsolute(Double[] data)

Returns the largest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

float MaximumAbsolute(Single[] data)

Returns the largest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

Complex32 MaximumMagnitudePhase(Complex32[] data)

Returns the largest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Complex32[] data

Sample array, no sorting is assumed.

Complex MaximumMagnitudePhase(Complex[] data)

Returns the largest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Complex[] data

Sample array, no sorting is assumed.

double Mean(Double[] data)

Estimates the arithmetic sample mean from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

double Mean(Int32[] data)

Estimates the arithmetic sample mean from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Int32[] data

Sample array, no sorting is assumed.

double Mean(Single[] data)

Estimates the arithmetic sample mean from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

Tuple<double, double> MeanStandardDeviation(Int32[] samples)

Estimates the arithmetic sample mean and the unbiased population standard deviation from the provided samples as unsorted array. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or any entry is NaN and NaN for standard deviation if data has less than two entries or if any entry is NaN.
Parameters
Int32[] samples

Sample array, no sorting is assumed.

Tuple<double, double> MeanStandardDeviation(Single[] samples)

Estimates the arithmetic sample mean and the unbiased population standard deviation from the provided samples as unsorted array. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or any entry is NaN and NaN for standard deviation if data has less than two entries or if any entry is NaN.
Parameters
Single[] samples

Sample array, no sorting is assumed.

Tuple<double, double> MeanStandardDeviation(Double[] samples)

Estimates the arithmetic sample mean and the unbiased population standard deviation from the provided samples as unsorted array. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or any entry is NaN and NaN for standard deviation if data has less than two entries or if any entry is NaN.
Parameters
Double[] samples

Sample array, no sorting is assumed.

Tuple<double, double> MeanVariance(Double[] samples)

Estimates the arithmetic sample mean and the unbiased population variance from the provided samples as unsorted array. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or any entry is NaN and NaN for variance if data has less than two entries or if any entry is NaN.
Parameters
Double[] samples

Sample array, no sorting is assumed.

Tuple<double, double> MeanVariance(Int32[] samples)

Estimates the arithmetic sample mean and the unbiased population variance from the provided samples as unsorted array. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or any entry is NaN and NaN for variance if data has less than two entries or if any entry is NaN.
Parameters
Int32[] samples

Sample array, no sorting is assumed.

Tuple<double, double> MeanVariance(Single[] samples)

Estimates the arithmetic sample mean and the unbiased population variance from the provided samples as unsorted array. On a dataset of size N will use an N-1 normalizer (Bessel's correction). Returns NaN for mean if data is empty or any entry is NaN and NaN for variance if data has less than two entries or if any entry is NaN.
Parameters
Single[] samples

Sample array, no sorting is assumed.

float MedianInplace(Single[] data)

Estimates the median value from the unsorted data array. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double MedianInplace(Double[] data)

Estimates the median value from the unsorted data array. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

float Minimum(Single[] data)

Returns the smallest value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

double Minimum(Double[] data)

Returns the smallest value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

double MinimumAbsolute(Double[] data)

Returns the smallest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

float MinimumAbsolute(Single[] data)

Returns the smallest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

Complex32 MinimumMagnitudePhase(Complex32[] data)

Returns the smallest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Complex32[] data

Sample array, no sorting is assumed.

Complex MinimumMagnitudePhase(Complex[] data)

Returns the smallest absolute value from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Complex[] data

Sample array, no sorting is assumed.

float OrderStatisticInplace(Single[] data, int order)

Returns the order statistic (order 1..N) from the unsorted data array. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

int order

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

double OrderStatisticInplace(Double[] data, int order)

Returns the order statistic (order 1..N) from the unsorted data array. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

int order

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

double PercentileInplace(Double[] data, int p)

Estimates the p-Percentile value from the unsorted data array. If a non-integer Percentile is needed, use Quantile instead. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

int p

Percentile selector, between 0 and 100 (inclusive).

float PercentileInplace(Single[] data, int p)

Estimates the p-Percentile value from the unsorted data array. If a non-integer Percentile is needed, use Quantile instead. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

int p

Percentile selector, between 0 and 100 (inclusive).

double PopulationCovariance(Int32[] population1, Int32[] population2)

Evaluates the population covariance from the full population provided as two arrays. 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
Int32[] population1

First population array.

Int32[] population2

Second population array.

double PopulationCovariance(Single[] population1, Single[] population2)

Evaluates the population covariance from the full population provided as two arrays. 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
Single[] population1

First population array.

Single[] population2

Second population array.

double PopulationCovariance(Double[] population1, Double[] population2)

Evaluates the population covariance from the full population provided as two arrays. 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
Double[] population1

First population array.

Double[] population2

Second population array.

double PopulationStandardDeviation(Single[] population)

Evaluates the population standard deviation from the full population provided as unsorted array. 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
Single[] population

Sample array, no sorting is assumed.

double PopulationStandardDeviation(Int32[] population)

Evaluates the population standard deviation from the full population provided as unsorted array. 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
Int32[] population

Sample array, no sorting is assumed.

double PopulationStandardDeviation(Double[] population)

Evaluates the population standard deviation from the full population provided as unsorted array. 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
Double[] population

Sample array, no sorting is assumed.

double PopulationVariance(Single[] population)

Evaluates the population variance from the full population provided as unsorted array. 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
Single[] population

Sample array, no sorting is assumed.

double PopulationVariance(Int32[] population)

Evaluates the population variance from the full population provided as unsorted array. 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
Int32[] population

Sample array, no sorting is assumed.

double PopulationVariance(Double[] population)

Evaluates the population variance from the full population provided as unsorted array. 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
Double[] population

Sample array, no sorting is assumed.

float QuantileCustomInplace(Single[] data, double tau, double a, double b, double c, double d)

Estimates the tau-th quantile from the unsorted data array. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile defintion can be specified by 4 parameters a, b, c and d, consistent with Mathematica. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double tau

Quantile selector, between 0.0 and 1.0 (inclusive)

double a

a-parameter

double b

b-parameter

double c

c-parameter

double d

d-parameter

double QuantileCustomInplace(Double[] data, double tau, QuantileDefinition definition)

Estimates the tau-th quantile from the unsorted data array. 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. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

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

float QuantileCustomInplace(Single[] data, double tau, QuantileDefinition definition)

Estimates the tau-th quantile from the unsorted data array. 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. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

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

double QuantileCustomInplace(Double[] data, double tau, double a, double b, double c, double d)

Estimates the tau-th quantile from the unsorted data array. The tau-th quantile is the data value where the cumulative distribution function crosses tau. The quantile defintion can be specified by 4 parameters a, b, c and d, consistent with Mathematica. WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

double tau

Quantile selector, between 0.0 and 1.0 (inclusive)

double a

a-parameter

double b

b-parameter

double c

c-parameter

double d

d-parameter

float QuantileInplace(Single[] data, double tau)

Estimates the tau-th quantile from the unsorted data array. The tau-th quantile is the data value where the cumulative distribution function crosses tau. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
R-8, SciPy-(1/3,1/3): Linear interpolation of the approximate medians for order statistics. When tau < (2/3) / (N + 1/3), use x1. When tau >= (N - 1/3) / (N + 1/3), use xN.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double tau

Quantile selector, between 0.0 and 1.0 (inclusive).

double QuantileInplace(Double[] data, double tau)

Estimates the tau-th quantile from the unsorted data array. The tau-th quantile is the data value where the cumulative distribution function crosses tau. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
R-8, SciPy-(1/3,1/3): Linear interpolation of the approximate medians for order statistics. When tau < (2/3) / (N + 1/3), use x1. When tau >= (N - 1/3) / (N + 1/3), use xN.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

double tau

Quantile selector, between 0.0 and 1.0 (inclusive).

Double[] RanksInplace(Single[] data, RankDefinition definition)

Evaluates the rank of each entry of the unsorted data array. The rank definition can be specified to be compatible with an existing system. WARNING: Works inplace and can thus causes the data array to be reordered.

Double[] RanksInplace(Double[] data, RankDefinition definition)

Evaluates the rank of each entry of the unsorted data array. The rank definition can be specified to be compatible with an existing system. WARNING: Works inplace and can thus causes the data array to be reordered.

double RootMeanSquare(Double[] data)

Estimates the root mean square (RMS) also known as quadratic mean from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Double[] data

Sample array, no sorting is assumed.

double RootMeanSquare(Single[] data)

Estimates the root mean square (RMS) also known as quadratic mean from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Single[] data

Sample array, no sorting is assumed.

double RootMeanSquare(Int32[] data)

Estimates the root mean square (RMS) also known as quadratic mean from the unsorted data array. Returns NaN if data is empty or any entry is NaN.
Parameters
Int32[] data

Sample array, no sorting is assumed.

double StandardDeviation(Single[] samples)

Estimates the unbiased population standard deviation from the provided samples as unsorted array. 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
Single[] samples

Sample array, no sorting is assumed.

double StandardDeviation(Double[] samples)

Estimates the unbiased population standard deviation from the provided samples as unsorted array. 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
Double[] samples

Sample array, no sorting is assumed.

double StandardDeviation(Int32[] samples)

Estimates the unbiased population standard deviation from the provided samples as unsorted array. 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
Int32[] samples

Sample array, no sorting is assumed.

float UpperQuartileInplace(Single[] data)

Estimates the third quartile value from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Single[] data

Sample array, no sorting is assumed. Will be reordered.

double UpperQuartileInplace(Double[] data)

Estimates the third quartile value from the unsorted data array. Approximately median-unbiased regardless of the sample distribution (R8). WARNING: Works inplace and can thus causes the data array to be reordered.
Parameters
Double[] data

Sample array, no sorting is assumed. Will be reordered.

double Variance(Double[] samples)

Estimates the unbiased population variance from the provided samples as unsorted array. 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
Double[] samples

Sample array, no sorting is assumed.

double Variance(Single[] samples)

Estimates the unbiased population variance from the provided samples as unsorted array. 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
Single[] samples

Sample array, no sorting is assumed.

double Variance(Int32[] samples)

Estimates the unbiased population variance from the provided samples as unsorted array. 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
Int32[] samples

Sample array, no sorting is assumed.