Class FrtbEs

java.lang.Object
com.quantfinlib.risk.FrtbEs

public final class FrtbEs extends Object
FRTB Internal Models Approach expected shortfall — the market-risk capital measure that replaced 10-day VaR: ES at 97.5%, computed on a base 10-day horizon and scaled up across LIQUIDITY HORIZONS (how long each risk factor class realistically takes to exit under stress: 10 days for major FX and rates, up to 120 for exotic credit), then anchored to a STRESSED period:
  ES = √( Σⱼ [ ESⱼ · √((LHⱼ − LHⱼ₋₁)/10) ]² )      (the LH cascade)
  IMCC = ES_current · (ES_stressed,reduced / ES_current,reduced)

Styled after BCBS MAR33, not certified — the same honesty stance as the LULD and ESMA-tick implementations elsewhere in this library: the FORMULAS are the regulation's, the tests pin their arithmetic, but regulatory capital additionally requires desk-level approvals, the full P&L attribution program (PnlAttribution), non-modellable risk factor (NMRF) capital, and the standardized-approach floor — all named in docs/MARKET_RISK.md as deliberately out of scope. Standard liquidity horizons are provided as LH_10LH_120. Research lane, static, deterministic.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The Basel backtesting traffic light over 250 days of 99% VaR exceptions: GREEN ≤ 4 (model fine), AMBER 5-9 (capital multiplier rises), RED ≥ 10 (model presumed wrong).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The five regulatory liquidity horizons, in days.
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    es975(double[] losses)
    ES at 97.5% of a loss sample (positive losses), the FRTB tail measure.
    static double
    liquidityHorizonEs(double[] esByHorizon, int[] horizons)
    The liquidity-horizon cascade: given the base 10-day ES computed on the FULL factor set and the ESs of the nested subsets that remain shocked at each longer horizon, aggregates per MAR33.5:
    static double
    stressCalibratedEs(double esCurrentFull, double esStressedReduced, double esCurrentReduced)
    The stressed-calibration multiplier (MAR33.6): current full-factor ES scaled by the reduced-factor-set ratio between the stressed period and today.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • es975

      public static double es975(double[] losses)
      ES at 97.5% of a loss sample (positive losses), the FRTB tail measure.
    • liquidityHorizonEs

      public static double liquidityHorizonEs(double[] esByHorizon, int[] horizons)
      The liquidity-horizon cascade: given the base 10-day ES computed on the FULL factor set and the ESs of the nested subsets that remain shocked at each longer horizon, aggregates per MAR33.5:
      Parameters:
      esByHorizon - esByHorizon[j] = 10-day ES with only the factors of liquidity horizon ≥ horizons[j] shocked; index 0 is the full set at LH 10
      horizons - ascending, starting at 10 (e.g. {10, 20, 60})
    • stressCalibratedEs

      public static double stressCalibratedEs(double esCurrentFull, double esStressedReduced, double esCurrentReduced)
      The stressed-calibration multiplier (MAR33.6): current full-factor ES scaled by the reduced-factor-set ratio between the stressed period and today. The reduced set exists because stressed-period data rarely covers every factor; the ratio transports the stress. The regulatory floor: the ratio is at least 1 — a calmer-than- today stressed period must not DISCOUNT capital.