2.2.3. Computing the elementary statistic
When considering an existing set of points, it exists a method to determine the four simplest statistical notions: the minimum, maximum, average and standard deviation.
The minimum and maximum are trivially estimated by running over all the possible values. The average and standard deviation are estimated on the fly, using the following recursive formulae (where \(\zeta_{i}\) represents the value of \(\zeta\) using all data points up to \(i\) for \(i = 1,\ldots,n_{S}\)):
average: \(\mu_{x_{0}}\) is set to 0 and then
\[\mu_{x_{i}} = \mu_{x_{i-1}} \times \frac{i}{i+1} + \frac{x_i}{i+1}\]
standard deviation: \(\sigma_{x_{0}}\) is set to 0 and then, for \(i\) strictly greater than 0,
\[\sigma_{x_{i}} = \sigma_{x_{i-1}} \times \frac{i-1}{i} + \frac{i+1}{i} \times \frac{(x_i-\mu_{x_{i}})^2}{i}\]