Namespaces

Types in MathNet.Numerics.Statistics

Type StreamingStatistics

Namespace MathNet.Numerics.Statistics

Statistics operating on an IEnumerable in a single pass, without keeping the full data in memory. Can be used in a streaming way, e.g. on large datasets not fitting into memory.

Static Functions

Public Static Functions

double Covariance(IEnumerable<double> samples1, IEnumerable<double> samples2)

Estimates the unbiased population covariance from the provided two sample enumerable sequences, in a single pass without memoization. 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

First sample stream.

IEnumerable<double> samples2

Second sample stream.

double Entropy(IEnumerable<double> stream)

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

The input stream to evaluate.

double GeometricMean(IEnumerable<double> stream)

Evaluates the geometric mean of the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

double HarmonicMean(IEnumerable<double> stream)

Evaluates the harmonic mean of the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

double Maximum(IEnumerable<double> stream)

Returns the largest value from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

double MaximumAbsolute(IEnumerable<double> stream)

Returns the largest absolute value from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

Complex MaximumMagnitudePhase(IEnumerable<Complex> stream)

Returns the largest absolute value from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<Complex> stream

Sample stream, no sorting is assumed.

double Mean(IEnumerable<double> stream)

Estimates the arithmetic sample mean from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

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

Estimates the arithmetic sample mean and the unbiased population standard deviation from the provided samples as enumerable sequence, in a single pass without memoization. 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
IEnumerable<double> samples

Sample stream, no sorting is assumed.

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

Estimates the arithmetic sample mean and the unbiased population variance from the provided samples as enumerable sequence, in a single pass without memoization. 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
IEnumerable<double> samples

Sample stream, no sorting is assumed.

double Minimum(IEnumerable<double> stream)

Returns the smallest value from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

double MinimumAbsolute(IEnumerable<double> stream)

Returns the smallest absolute value from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

Complex MinimumMagnitudePhase(IEnumerable<Complex> stream)

Returns the smallest absolute value from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<Complex> stream

Sample stream, no sorting is assumed.

double PopulationCovariance(IEnumerable<double> population1, IEnumerable<double> population2)

Evaluates the population covariance from the full population provided as two enumerable sequences, in a single pass without memoization. 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

First population stream.

IEnumerable<double> population2

Second population stream.

double PopulationStandardDeviation(IEnumerable<double> population)

Evaluates the population standard deviation from the full population provided as enumerable sequence, in a single pass without memoization. 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

Sample stream, no sorting is assumed.

double PopulationVariance(IEnumerable<double> population)

Evaluates the population variance from the full population provided as enumerable sequence, in a single pass without memoization. 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

Sample stream, no sorting is assumed.

double RootMeanSquare(IEnumerable<double> stream)

Estimates the root mean square (RMS) also known as quadratic mean from the enumerable, in a single pass without memoization. Returns NaN if data is empty or any entry is NaN.
Parameters
IEnumerable<double> stream

Sample stream, no sorting is assumed.

double StandardDeviation(IEnumerable<double> samples)

Estimates the unbiased population standard deviation from the provided samples as enumerable sequence, in a single pass without memoization. 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

Sample stream, no sorting is assumed.

double Variance(IEnumerable<double> samples)

Estimates the unbiased population variance from the provided samples as enumerable sequence, in a single pass without memoization. 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

Sample stream, no sorting is assumed.