Exponential Moving Average
📐 Definition
Section titled “📐 Definition”For sequence , smoothing factor , and initial , define
Domain and Codomain
Section titled “Domain and Codomain”Applies to real or complex sequences with bounded values. Output follows the same codomain.
⚙️ Key Properties
Section titled “⚙️ Key Properties”Weights decay geometrically: contribution of is . Effective window length is . Linear and causal.
As , tracks the latest sample; as , smoothing approaches a constant memory with slow adaptation. For constant input , .
🎯 Special Cases and Limits
Section titled “🎯 Special Cases and Limits”- yields (no smoothing).
- Small yields slow adaptation with long memory.
🔗 Related Functions
Section titled “🔗 Related Functions”Welford statistics provide unbiased variance updates; simple mean uses uniform weighting rather than exponential decay.
Usage in Oakfield
Section titled “Usage in Oakfield”Oakfield uses EMAs for smoothing diagnostics and lock detection:
- Phase coherence EMA: runtime stats track
phase_coherence_emausing an exponential smoothing constant (seconds) and a hysteresis lock state. - General smoothing helper:
runtime/sim_smoothing.hprovides a canonicala = exp(-dt/tau)form used for stable time-constant smoothing in other subsystems.
Historical Foundations
Section titled “Historical Foundations”📜 Recursive Smoothing
Section titled “📜 Recursive Smoothing”Exponential smoothing is a standard recursive filter in time series analysis, trading unbiasedness for adaptivity and a simple one-step update.
🌍 Modern Perspective
Section titled “🌍 Modern Perspective”EMA is widely used for online diagnostics and stabilizing noisy signals in simulation and optimization loops.
📚 References
Section titled “📚 References”- Hamilton, Time Series Analysis
- Oppenheim & Schafer, Discrete-Time Signal Processing