Skip to main content

ewma_volatility

Function ewma_volatility 

Source
pub fn ewma_volatility(
    returns: &[f64],
    lambda: f64,
    periods_per_year: f64,
) -> f64
Expand description

EWMA (RiskMetrics) volatility: sigma_t^2 = lambda sigma_{t-1}^2 + (1 - lambda) r_t^2, seeded with the first squared return. Returns the annualized latest estimate; lambda = 0.94 is the classic daily-decay choice.