OpenQuant Docs banner
OpenQuant icon openquant-rs / documentation terminal

util::fast_ewma

Market Microstructure, Dependence and Regime Detection

Fast EWMA primitive shared across feature and volatility routines.

Why This Module Exists

Provides performant smoothing for repeated rolling computations.

Key Public APIs

  • ewma

Core Math

EWMA

\[m_t=\alpha x_t + (1-\alpha)m_{t-1}\]

Smoothing

\[\alpha=\frac{2}{w+1}\]

Code Examples

Compute EWMA vector

use openquant::util::fast_ewma::ewma;

let x = vec![1.0, 2.0, 3.0, 4.0];
let y = ewma(&x, 3);

Implementation Notes

  • Window length controls responsiveness vs smoothness.
  • Prefer this helper over ad-hoc loops for consistency.