Class FrtbEs
java.lang.Object
com.quantfinlib.risk.FrtbEs
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_10 … LH_120.
Research lane, static, deterministic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic doublees975(double[] losses) ES at 97.5% of a loss sample (positive losses), the FRTB tail measure.static doubleliquidityHorizonEs(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 doublestressCalibratedEs(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.
-
Field Details
-
LH_10
public static final int LH_10The five regulatory liquidity horizons, in days.- See Also:
-
LH_20
public static final int LH_20- See Also:
-
LH_40
public static final int LH_40- See Also:
-
LH_60
public static final int LH_60- See Also:
-
LH_120
public static final int LH_120- See Also:
-
-
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 10horizons- 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.
-