Rapid Calculation Methods
It has been suggested that this article be merged into Algorithms for calculating variance. (Discuss) |
The following two formulas can represent a running (continuous) standard deviation. A set of two power sums s1 and s2 are computed over a set of N values of x, denoted as x1, ..., xN:
Given the results of these three running summations, the values N, s1, s2 can be used at any time to compute the current value of the running standard deviation:
Where :
Similarly for sample standard deviation,
In a computer implementation, as the three sj sums become large, we need to consider round-off error, arithmetic overflow, and arithmetic underflow. The method below calculates the running sums method with reduced rounding errors. This is a "one pass" algorithm for calculating variance of n samples without the need to store prior data during the calculation. Applying this method to a time series will result in successive values of standard deviation corresponding to n data points as n grows larger with each new sample, rather than a constant-width sliding window calculation.
For k = 1, ..., n:
where A is the mean value.
Sample variance:
Population variance:
Read more about this topic: Sample Standard Deviation
Famous quotes containing the words rapid, calculation and/or methods:
“It now appears that the negro race is, more than any other, susceptible of rapid civilization. The emancipation is observed, in the islands, to have wrought for the negro a benefit as sudden as when a thermometer is brought out of the shade into the sun. It has given him eyes and ears.”
—Ralph Waldo Emerson (18031882)
“Common sense is the measure of the possible; it is composed of experience and prevision; it is calculation appled to life.”
—Henri-Frédéric Amiel (18211881)
“A woman might claim to retain some of the childs faculties, although very limited and defused, simply because she has not been encouraged to learn methods of thought and develop a disciplined mind. As long as education remains largely induction ignorance will retain these advantages over learning and it is time that women impudently put them to work.”
—Germaine Greer (b. 1939)