Browse Source

Statistics: minor reordering (no code change)

v2
Christoph Ruegg 13 years ago
parent
commit
1580a3d4ec
  1. 22
      src/Numerics/Statistics/ArrayStatistics.cs
  2. 22
      src/Numerics/Statistics/StreamingStatistics.cs

22
src/Numerics/Statistics/ArrayStatistics.cs

@ -128,17 +128,6 @@ namespace MathNet.Numerics.Statistics
return variance/(samples.Length - 1);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="samples">Sample array, no sorting is assumed.</param>
public static double StandardDeviation(double[] samples)
{
return Math.Sqrt(Variance(samples));
}
/// <summary>
/// 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;
}
/// <summary>
/// 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.
/// </summary>
/// <param name="samples">Sample array, no sorting is assumed.</param>
public static double StandardDeviation(double[] samples)
{
return Math.Sqrt(Variance(samples));
}
/// <summary>
/// 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.

22
src/Numerics/Statistics/StreamingStatistics.cs

@ -140,17 +140,6 @@ namespace MathNet.Numerics.Statistics
return j > 1 ? variance/(j - 1) : double.NaN;
}
/// <summary>
/// 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.
/// </summary>
/// <param name="samples">Sample stream, no sorting is assumed.</param>
public static double StandardDeviation(IEnumerable<double> samples)
{
return Math.Sqrt(Variance(samples));
}
/// <summary>
/// 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;
}
/// <summary>
/// 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.
/// </summary>
/// <param name="samples">Sample stream, no sorting is assumed.</param>
public static double StandardDeviation(IEnumerable<double> samples)
{
return Math.Sqrt(Variance(samples));
}
/// <summary>
/// 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.

Loading…
Cancel
Save