Class VolatilityIndex

java.lang.Object
com.quantfinlib.volatility.VolatilityIndex

public final class VolatilityIndex extends Object
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. No pricing model is assumed; the index is the variance-swap replication (Carr-Madan / CBOE methodology, single expiry):
  σ² = (2/T)·Σᵢ (ΔKᵢ/Kᵢ²)·e^{rT}·Q(Kᵢ)  −  (1/T)·(F/K₀ − 1)²
where Q(K) is the OUT-OF-THE-MONEY option mid at strike K (puts below the forward, calls above, the put/call average at the pivot K₀ — the highest strike at or below F), ΔK the half-distance between neighboring strikes, and the last term corrects for K₀ ≠ F.

Why OTM options? Each strike's option contributes exactly the 1/K² slice needed to build a constant-dollar-gamma payoff — a position whose P&L IS realized variance. The market prices that portfolio, so the portfolio's price reveals the market's variance expectation, whatever model anyone used. That is why a vol SMILE raises the index above ATM implied vol: the wings carry real premium and the replication weights them in.

Honesty notes: single-expiry (the CBOE interpolates two expiries to exactly 30 days — supply the chain nearest your target tenor, or compute two indices and interpolate variance in time); truncation bias: strikes should span several σ√T or the index reads LOW (the tails you cannot see are variance you do not count). Styled after the methodology, not certified. Research lane, static, deterministic.

  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    index(double[] strikes, double[] putMids, double[] callMids, double forward, double rate, double tYears)
    The index (annualized volatility, e.g. 0.20 = "a VIX of 20") from one expiry's chain.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • index

      public static double index(double[] strikes, double[] putMids, double[] callMids, double forward, double rate, double tYears)
      The index (annualized volatility, e.g. 0.20 = "a VIX of 20") from one expiry's chain.
      Parameters:
      strikes - ascending strikes, ≥ 3, all > 0
      putMids - put mid prices per strike, ≥ 0, finite
      callMids - call mid prices per strike, ≥ 0, finite
      forward - the forward F for this expiry, strictly inside (strikes[0], strikes[last]) — an index built on extrapolation would be an opinion, not a measurement
      rate - continuously-compounded rate to expiry
      tYears - time to expiry, > 0