UnivariateCorrectedStandardDeviation Method |
Namespace: Meta.Numerics.Statistics
public static double CorrectedStandardDeviation( this IReadOnlyCollection<double> sample )
Exception | Condition |
---|---|
ArgumentNullException | sample is . |
This probably isn't the quantity you want, even though it's what many software packages refer to as the "standard deviation", and some authors even misleadingly call the "sample standard deviation". It is the square root of the sum of the squared deviations from the mean, divided by n-1 instead of n.
Using n-1 instead of n in the formula for variance produces an unbiased estimator of the PopulationVariance(IReadOnlyCollectionDouble). But using n-1 instead of n in the formula for standard deviation, which is how this property is computed, does not produce an unbiased estimator of the population's standard deviation. Our implementation of PopulationStandardDeviation(IReadOnlyCollectionDouble) does a better job of reducing bias, so you should use it instead if that is what you are trying to estimate. The main reason this property exists at all is to satisfy users who want to compute the exact same value that another software package did.