RosettaCodeData/Task/Cumulative-standard-deviation/00-TASK.txt
2023-07-01 11:58:00 -04:00

21 lines
821 B
Text

{{task heading}}
Write a stateful function, class, generator or co-routine that takes a series of floating point numbers, ''one at a time'', and returns the running [[wp:Standard Deviation|standard deviation]] of the series.
The task implementation should use the most natural programming style of those listed for the function in the implementation language; the task ''must'' state which is being used.
Do not apply [[wp:Bessel's correction|Bessel's correction]]; the returned standard deviation should always be computed as if the sample seen so far is the entire population.
;Test case:
Use this to compute the standard deviation of this demonstration set, <math>\{2, 4, 4, 4, 5, 5, 7, 9\}</math>, which is <math>2</math>.
;Related tasks:
* [[Random numbers]]
{{Related tasks/Statistical measures}}
<hr>