Medium · Python / C++ Quant Coding · Coding · ~10 min · #42
EWMA Volatility Filter
The exponentially weighted moving-average (EWMA) variance estimator updates
starting from an initial variance .
Implement ewma_variance(returns: list[float], lam: float, v0: float) -> list[float] returning .
Examples
Input: ewma_variance([0.0, 0.0], 0.9, 0.04)
Output: [0.036, 0.0324]
Constraints
- •
0 < lam < 1
- •
v0 ≥ 0
Hints · 0 of 1 shown
Worked solution
Give the problem an honest attempt first, then reveal the full explanation.
Related questions
Concepts
EWMAVolatility clusteringRecursive filters
Relevant for
Quant DeveloperQuant ResearcherDesk Quant