- **Similar:** [Variance](../variance/Variance.md), [MeanDev](../meandev/MeanDev.md) | **Trading note:** Standard deviation; foundational volatility measure. Used in Bollinger Bands, VaR, and Sharpe ratio.
Standard Deviation measures the amount of variation or dispersion of a set of values. A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, while a high standard deviation indicates that the values are spread out over a wider range.
## Historical Context
The concept of standard deviation was introduced by Karl Pearson in 1893. It has since become the most common measure of statistical dispersion in finance, used to quantify volatility and risk.
## Architecture & Physics
`StdDev` is implemented as a wrapper around the highly optimized `Variance` indicator. It leverages the O(1) streaming updates and SIMD-accelerated batch processing of `Variance`, applying a square root transformation to the result.
### Zero-Allocation Design
The implementation ensures zero heap allocations during the `Update` cycle. The `Batch` method operates directly on `Span<double>` using SIMD instructions (AVX2, AVX512, Neon) where available, ensuring maximum throughput for large datasets.
## Mathematical Foundation
Standard Deviation is the square root of Variance.
O(1) per update. sqrt() dominates at ~14 cy. Periodic resync prevents catastrophic cancellation in the shortcut variance formula for near-constant series.