Class ExtremeValueTheory

java.lang.Object
com.quantfinlib.risk.ExtremeValueTheory

public final class ExtremeValueTheory extends Object
Extreme value theory via peaks-over-threshold — the statistically honest way to ask about quantiles BEYOND the sample. Historical VaR at 99.9% from 500 observations is reading the worst half-observation; EVT instead fits the Generalized Pareto Distribution to the exceedances over a high threshold (the Pickands-Balkema-de Haan theorem says the tail of ANY well-behaved distribution converges to a GPD), then extrapolates along the fitted tail:
  VaR_p = u + (β/ξ)·[((n/Nᵤ)(1−p))^{−ξ} − 1]

The shape ξ is the number to stare at: ξ ≈ 0 is an exponential tail (Gaussian-ish), ξ > 0 is a power-law tail (fat — equity returns typically fit ξ ≈ 0.2-0.4), and ξ ≥ 1 means the tail mean does not even exist (expectedShortfall refuses rather than returning a finite lie). Fitting uses probability-weighted moments — closed-form, no optimizer, well-behaved for ξ < 0.5 (documented range; MLE's edge beyond that is not worth an optimizer dependency). The threshold choice is the caller's judgment call — the classic diagnostic is fitting at several thresholds and checking ξ stability; a quantile between 0.90 and 0.95 of the losses is the usual start. Research lane, deterministic.

  • Method Details

    • fitPot

      public static ExtremeValueTheory.GpdFit fitPot(double[] losses, double thresholdQuantile)
      Fits a GPD to the losses exceeding the thresholdQuantile of the sample (e.g. 0.90), via probability-weighted moments. Losses are positive numbers (feed -returns or a loss series directly).