Ejemplo n.º 1
0
        /// <summary>
        /// Evaluates the population 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.
        /// </summary>
        /// <param name="population">The full population data.</param>
        public static double PopulationStandardDeviation(this IEnumerable <double> population)
        {
            var array = population as double[];

            return(array != null
                ? ArrayStatistics.PopulationStandardDeviation(array)
                : StreamingStatistics.PopulationStandardDeviation(population));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Evaluates the population 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.
 /// Null-entries are ignored.
 /// </summary>
 /// <param name="population">The full population data.</param>
 public static double PopulationStandardDeviation(this IEnumerable <double?> population)
 {
     if (population == null)
     {
         throw new ArgumentNullException("population");
     }
     return(StreamingStatistics.PopulationStandardDeviation(population.Where(d => d.HasValue).Select(d => d.Value)));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Evaluates the population 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.
 /// Null-entries are ignored.
 /// </summary>
 /// <param name="population">The full population data.</param>
 public static double PopulationStandardDeviation(this IEnumerable <double?> population)
 {
     return(StreamingStatistics.PopulationStandardDeviation(population.Where(d => d.HasValue).Select(d => d.Value)));
 }