Skip to content
All library documents

Variance, Standard Deviation, and Welford’s Single-Pass Method

Article MQL5 code base

Summary

The document explains dispersion through standard deviation: it describes how spread out dataset values are around their mean. Values clustered near the mean correspond to a smaller standard deviation, while widely dispersed values correspond to a larger one. For a sample, standard deviation is defined as the square root of variance. These concepts are relevant to quantitative work because they summarize variability, although the note does not connect them to a specific trading application.

It also points to Welford’s single-pass method for calculating variance. The stated motivation is numerical stability: when variance is small relative to the square of the mean, computing differences can cause catastrophic cancellation, eliminating significant leading digits and creating large relative error. The document does not provide the method’s recurrence, a worked example, or a comparison of numerical results. It therefore introduces the computational concern and names a potential remedy, but is not a complete implementation guide or evidence of trading performance.

Key ideas

  • Standard deviation measures how dispersed a dataset is around its mean.
  • For a sample, standard deviation is the square root of variance.
  • Welford’s method is identified as a single-pass way to compute variance.
  • The method is motivated by avoiding catastrophic cancellation when variance is small compared with the squared mean.
  • The document gives no recurrence or worked calculation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.