> *The square root is nature's variance-stabilizing trick—halving the exponent space while preserving monotonicity. When price volatility scales with level, sqrt compresses the noise.*
The Square Root (SQRT) transformer applies $\sqrt{x}$ to each value in a time series. This variance-stabilizing transformation compresses ranges where volatility scales with magnitude, making it useful for heteroscedastic data where standard deviation increases with price level.
1.**Negative Input**: Prices are always positive, but derived values (returns, differences) can be negative. Sqrt is undefined for negatives—this implementation returns last valid value.
2.**Zero Amplification**: Near zero, small changes in input cause large changes in sqrt output. $\sqrt{0.01} = 0.1$ but $\sqrt{0.0001} = 0.01$—a 100x input change yields only 10x output change.
3.**Reversal Requires Squaring**: To undo sqrt, square the result. Unlike log/exp which are inverses, sqrt/square are only one-way inverses for non-negative values.
4.**Variance Stabilization Assumption**: Sqrt is optimal when variance scales linearly with mean. For other heteroscedasticity patterns, log or Box-Cox may be more appropriate.
5.**Magnitude Compression**: Sqrt compresses large values more than small ones. $\sqrt{10000} = 100$ but $\sqrt{100} = 10$. This can distort technical analysis patterns that depend on absolute price levels.
## Validation
| Test | Status |
|:-----|:------:|
| **Math.Sqrt Parity** | ✅ |
| **Perfect Squares (0,1,4,9,16,25,100)** | ✅ |
| **Irrational Results (√2, √3, √5)** | ✅ |
| **Inverse of Square** | ✅ |
| **Product Rule** | ✅ |
| **Quotient Rule** | ✅ |
| **Power Relationship (x^0.5)** | ✅ |
| **Small Values (1e-10 to 1e-2)** | ✅ |
| **Large Values (1e10 to 1e100)** | ✅ |
## References
- Box, G.E.P., & Cox, D.R. (1964). "An Analysis of Transformations." *Journal of the Royal Statistical Society, Series B*, 26(2), 211-252.
- Tukey, J.W. (1977). *Exploratory Data Analysis*. Addison-Wesley. (Variance-stabilizing transformations)