Package com.quantfinlib.volatility
@NullMarked
package com.quantfinlib.volatility
Volatility models: EWMA, GARCH-family, HAR-RV, a model-free volatility
index and a systematic/idiosyncratic decomposition.
EwmaVolatility
(RiskMetrics exponentially-weighted variance, λ = 0.94),
Garch11 (Gaussian MLE with variance
targeting; conditional variances and mean-reverting k-step forecasts)
and GjrGarch11 (Glosten, Jagannathan
and Runkle, 1993: a down move raises next-period variance by α + γ, an
up move by α; a fitted γ near 0 indicates a symmetric series),
Egarch11 (Nelson, 1991: log-variance
dynamics, leverage as γ < 0, no positivity constraints needed; one-step forecasts exact, multi-step
refused since the log recursion forecasts the median,
not the mean), and
HarRv (Corsi, 2009: heterogeneous
autoregressive realized-volatility model, daily, weekly and monthly
horizons fitted by OLS; pair it with microstructure.JumpRobustVolatility's bipower
variance to keep jumps out of the forecast). Also:
VolatilityIndex (a VIX-style index
computed model-free from an option chain by variance-swap replication;
it includes the smile, so it usually sits above ATM implied vol) and
VolatilityDecomposition
(systematic versus idiosyncratic: the OLS split
Var(asset) = β²·Var(market) + Var(residual), separating what an
index hedge removes from what needs diversification or single-name
hedges). Historical volatility lives in
risk.RiskMetrics.annualizedVolatility and
EwmaVolatility; implied volatility in
pricing.BlackScholes.impliedVol, pricing.Black76,
and the two vol surfaces. Feed the outputs to parametric VaR, vol
targeting, or option pricing; stochastic volatility lives in
pricing.Heston.-
ClassDescriptionEGARCH(1,1) — Nelson's exponential GARCH, the log-variance dynamics the plain family cannot express:Exponentially weighted moving average variance (RiskMetrics Technical Document, J.P.GARCH(1,1) volatility model (Bollerslev 1986, J.A fitted model with its uncertainty.GJR-GARCH(1,1,1) — GARCH with the leverage term equity markets demand:HAR-RV (Corsi's Heterogeneous AutoRegressive realized-volatility model) — the forecasting benchmark GARCH papers have to beat, and it is three regressors and an intercept:Fitted coefficients with Newey-West standard errors (order: intercept, daily, weekly, monthly), residual variance and the regression size.Fitted coefficients:
rv⁺ = c + βd·d + βw·w + βm·m.AIC and BIC information criteria for model selection.Distribution of the standardised innovationz_t = r_t / √h_tin the GARCH-family likelihoods.Range-based volatility estimators — the free lunch hiding inside every OHLC bar: the high-low range carries far more information about the day's variance than the close alone, so a range estimator reaches a given precision with several times fewer bars than close-to-close.Systematic vs idiosyncratic volatility — the decomposition behind "how much of this stock's risk is the market, and how much is the company?"Systematic and idiosyncratic split of an asset's variance.A VIX-style market volatility index — the "fear gauge": the market's own 30-day volatility expectation, read model-free out of an option chain.