diff --git a/src/Numerics/Statistics/ArrayStatistics.cs b/src/Numerics/Statistics/ArrayStatistics.cs index f338eb5e..28418d07 100644 --- a/src/Numerics/Statistics/ArrayStatistics.cs +++ b/src/Numerics/Statistics/ArrayStatistics.cs @@ -128,17 +128,6 @@ namespace MathNet.Numerics.Statistics return variance/(samples.Length - 1); } - /// - /// 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. - /// - /// Sample array, no sorting is assumed. - public static double StandardDeviation(double[] samples) - { - return Math.Sqrt(Variance(samples)); - } - /// /// 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. @@ -161,6 +150,17 @@ namespace MathNet.Numerics.Statistics return variance/population.Length; } + /// + /// 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. + /// + /// Sample array, no sorting is assumed. + public static double StandardDeviation(double[] samples) + { + return Math.Sqrt(Variance(samples)); + } + /// /// 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. diff --git a/src/Numerics/Statistics/StreamingStatistics.cs b/src/Numerics/Statistics/StreamingStatistics.cs index 6be6d5cb..5ee9c53c 100644 --- a/src/Numerics/Statistics/StreamingStatistics.cs +++ b/src/Numerics/Statistics/StreamingStatistics.cs @@ -140,17 +140,6 @@ namespace MathNet.Numerics.Statistics return j > 1 ? variance/(j - 1) : double.NaN; } - /// - /// 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. - /// - /// Sample stream, no sorting is assumed. - public static double StandardDeviation(IEnumerable samples) - { - return Math.Sqrt(Variance(samples)); - } - /// /// 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. @@ -184,6 +173,17 @@ namespace MathNet.Numerics.Statistics return variance/j; } + /// + /// 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. + /// + /// Sample stream, no sorting is assumed. + public static double StandardDeviation(IEnumerable samples) + { + return Math.Sqrt(Variance(samples)); + } + /// /// 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.