Package com.quantfinlib.volatility
package com.quantfinlib.volatility
Volatility models:
EwmaVolatility
(RiskMetrics exponentially-weighted variance, λ = 0.94),
Garch11 (Gaussian MLE with variance
targeting; conditional variances and mean-reverting k-step forecasts)
and GjrGarch11 (the leverage-effect
asymmetry equity indices demand — a down move raises tomorrow's
variance by α + γ, an up move by only α; fitting γ ≈ 0 is itself the
finding that the series is symmetric),
Egarch11 (Nelson's log-variance
dynamics: leverage as a SIGN — γ < 0 — with no positivity
constraints by construction; one-step forecasts exact, multi-step
deliberately refused since the log recursion forecasts the median,
not the mean), and
HarRv (Corsi's heterogeneous
autoregressive realized-vol model — daily/weekly/monthly horizons by
plain OLS, the forecasting benchmark GARCH papers have to beat; pair
it with microstructure.JumpRobustVolatility's bipower
variance to keep jumps out of the forecast). Two more members of the
volatility zoo: VolatilityIndex
(the VIX-style "fear gauge" — MARKET volatility read model-free out
of an option chain via the variance-swap replication; the smile is
IN the index, which is why it sits above ATM implied vol) and
VolatilityDecomposition
(SYSTEMATIC vs IDIOSYNCRATIC: the exact OLS split
Var(asset) = β²·Var(market) + Var(residual) — what index
hedges can remove vs what only diversification or single-name
hedges address). 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-style):
h_t = λ h_{t-1} + (1-λ) r_{t-1}², seeded with the sample variance.GARCH(1,1) volatility model with Gaussian maximum-likelihood fitting:h_t = ω + α r_{t-1}² + β h_{t-1}.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:rv⁺ = c + βd·d + βw·w + βm·m.AIC / BIC — the two numbers that keep model shopping honest.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?"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.