/// <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)); }
/// <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))); }
/// <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))); }