UnivariatePopulationStandardDeviation Method |
Namespace: Meta.Numerics.Statistics
public static UncertainValue PopulationStandardDeviation( this IReadOnlyCollection<double> sample )
Exception | Condition |
---|---|
ArgumentNullException | sample is . |
InsufficientDataException | sample contains fewer than 3 values. |
In contrast to the StandardDeviation(IReadOnlyCollectionDouble) method, this method estimates the standard deviation of the underlying population from which the sample was drawn, and provides an error estimate for that value.
Note that the value returned by this method is not exactly the square root of the value returned by PopulationVariance(IReadOnlyCollectionDouble) (nor is it exactly the same as the value of CorrectedStandardDeviation(IReadOnlyCollectionDouble), which is exactly the square root of the variance best estimate). This is not an error. The variance estimator has a distribution. The mean of that distribution is equal to the variance of the underlying population, which is what makes the estimator unbiased. An unbiased estimator of the standard deviation will have that same property -- its mean will equal the standard deviation of the underlying population. But the square root of the mean of a distributed quantity is not the mean of the square root of that quantity, so the square root of the unbiased estimator of the variance will not an be unbiased estimator of the standard deviation. This method estimates that bias and corrects for it. The estimation is not exact, so the value returned by this method will not be perfectly unbiased, but it is likely to be less biased than CorrectedStandardDeviation(IReadOnlyCollectionDouble).