diff --git a/Docs/Internal/Exposure/ExposureAnalytics_v3.76.pdf b/Docs/Internal/Exposure/ExposureAnalytics_v3.76.pdf new file mode 100644 index 000000000000..e3d11d158a5e Binary files /dev/null and b/Docs/Internal/Exposure/ExposureAnalytics_v3.76.pdf differ diff --git a/ReleaseNotes/08_30_2018.txt b/ReleaseNotes/08_30_2018.txt new file mode 100644 index 000000000000..665c20c6c6bc --- /dev/null +++ b/ReleaseNotes/08_30_2018.txt @@ -0,0 +1,50 @@ + +Features: + +Bug Fixes/Clean-up: + + - Bucket IR Curvature Settings Circle (16, 17) + - Equity/Commodity/FX SIMM Packages (59) + + +Samples: + + - FX Delta Sensitivity Margin (1) + - FX Vega Sensitivity Margin (2) + - FX Curvature Sensitivity Margin (3) + - IR Currency Delta Margin (4, 5) + - IR Delta Sensitivity Margin (6) + - IR Currency Vega Margin (7, 8) + - IR Vega Sensitivity Margin (9) + - IR Currency Curvature Flow #1 (10, 11) + - IR Currency Curvature Flow #2 (12, 13) + - IR Currency Curvature Flow #3 (14, 15) + - IR Currency Curvature Flow #4 (18, 19) + - IR Currency Curvature Flow #5 (20, 21) + - IR Currency Curvature Flow #6 (22, 23) + - IR Currency Curvature Flow #7 (24, 25) + - IR Currency Curvature Flow #8 (26, 27) + - IR Currency Curvature Flow #9 (28, 29) + - IR Currency Curvature Flow #10 (30, 31) + - IR Currency Curvature Flow #11 (32, 33) + - IR Currency Curvature Flow #12 (34, 35) + - IR Currency Curvature Flow #13 (36, 37) + - IR Currency Curvature Flow #14 (38, 39) + - Commodity Risk Concentration Threshold 2.0 (40) + - SIMM Commodity Settings 2.0 (41) + - Credit Non/Qualifying SIMM 2.0 (42, 43) + - Credit Risk Concentration Threshold 2.0 (44) + - Equity Risk Concentration Threshold 2.0 (45) + - SIMM 2.0 Equity Settings (46) + - SIMM 2.0 FX Settings (47) + - SIMM 2.0 Interest Rate Settings (48) + - Interest Rate Concentration Threshold 2.0 (49) + - SIMM Commodity Delta Margin 2.0 (50) + - SIMM Commodity Vega Margin 2.0 (51) + - SIMM Commodity Curvature Margin 2.0 (52) + - SIMM FX Delta Margin 2.0 (53) + - SIMM FX Vega Margin 2.0 (54) + - SIMM FX Curvature Margin 2.0 (55) + - SIMM Equity Delta Margin 2.0 (56) + - SIMM Equity Vega Margin 2.0 (57) + - SIMM Equity Curvature Margin 2.0 (58) diff --git a/src/main/java/org/drip/sample/simm20estimates/IRCurrencyCurvatureMargin.java b/src/main/java/org/drip/sample/simm20estimates/IRCurrencyCurvatureMargin.java new file mode 100644 index 000000000000..5f3f1d70c7c2 --- /dev/null +++ b/src/main/java/org/drip/sample/simm20estimates/IRCurrencyCurvatureMargin.java @@ -0,0 +1,553 @@ + +package org.drip.sample.simm20estimates; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.drip.quant.common.FormatUtil; +import org.drip.service.env.EnvManager; +import org.drip.simm20.margin.IRSensitivityAggregate; +import org.drip.simm20.margin.RiskMeasureAggregateIR; +import org.drip.simm20.parameters.RiskMeasureSensitivitySettingsIR; +import org.drip.simm20.product.BucketSensitivityIR; +import org.drip.simm20.product.RiskFactorTenorSensitivity; +import org.drip.simm20.product.RiskMeasureSensitivityIR; + +/* + * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + */ + +/*! + * Copyright (C) 2018 Lakshmi Krishnamurthy + * + * This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model + * libraries targeting analysts and developers + * https://lakshmidrip.github.io/DRIP/ + * + * DRIP is composed of four main libraries: + * + * - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/ + * - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/ + * - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/ + * - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/ + * + * - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options, + * Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA + * Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV + * Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM + * Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics. + * + * - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy + * Incorporator, Holdings Constraint, and Transaction Costs. + * + * - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality. + * + * - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * IRCurrencyCurvatureMargin illustrates the Computation of the IR Curvature Margin for a Currency Bucket's + * IR Exposure Sensitivities. The References are: + * + * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, + * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. + * + * - Albanese, C., S. Caenazzo, and O. Frankel (2017): Regression Sensitivities for Initial Margin + * Calculations, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2763488, eSSRN. + * + * - Anfuso, F., D. Aziz, P. Giltinan, and K. Loukopoulus (2017): A Sound Modeling and Back-testing + * Framework for Forecasting Initial Margin Requirements, + * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2716279, eSSRN. + * + * - Caspers, P., P. Giltinan, R. Lichters, and N. Nowaczyk (2017): Forecasting Initial Margin Requirements + * - A Model Evaluation https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2911167, eSSRN. + * + * - International Swaps and Derivatives Association (2017): SIMM v2.0 Methodology, + * https://www.isda.org/a/oFiDE/isda-simm-v2.pdf. + * + * @author Lakshmi Krishnamurthy + */ + +public class IRCurrencyCurvatureMargin +{ + + private static final RiskFactorTenorSensitivity CurveTenorSensitivityMap ( + final double notional) + throws Exception + { + Map tenorSensitivityMap = new HashMap(); + + tenorSensitivityMap.put ( + "2W", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "1M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "3M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "6M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "1Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "2Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "3Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "5Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "10Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "15Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "20Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "30Y", + notional * (Math.random() - 0.5) + ); + + return new RiskFactorTenorSensitivity (tenorSensitivityMap); + } + + private static final void DisplayBucketSensitivityIR ( + final String currency, + final BucketSensitivityIR bucketSensitivityIR) + throws Exception + { + Map oisTenorSensitivity = bucketSensitivityIR.oisTenorSensitivity().sensitivityMap(); + + Map libor1MTenorSensitivity = + bucketSensitivityIR.libor1MTenorSensitivity().sensitivityMap(); + + Map libor3MTenorSensitivity = + bucketSensitivityIR.libor3MTenorSensitivity().sensitivityMap(); + + Map libor6MTenorSensitivity = + bucketSensitivityIR.libor6MTenorSensitivity().sensitivityMap(); + + Map libor12MTenorSensitivity = + bucketSensitivityIR.libor12MTenorSensitivity().sensitivityMap(); + + Map primeTenorSensitivity = + bucketSensitivityIR.primeTenorSensitivity().sensitivityMap(); + + Map municipalTenorSensitivity = + bucketSensitivityIR.municipalTenorSensitivity().sensitivityMap(); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| " + currency + " INTEREST CURVE TENOR SENSITIVITY ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| ||"); + + System.out.println ("\t|| L -> R: ||"); + + System.out.println ("\t|| - Curve Type ||"); + + System.out.println ("\t|| - OIS Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR1M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR3M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR6M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR12M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - PRIME Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - MUNICIPAL Tenor Curvature Sensitivity ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| OIS | LIBOR1M | LIBOR3M | LIBOR6M | LIBOR12M | PRIME | MUNICIPAL ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + for (String tenor : oisTenorSensitivity.keySet()) + { + System.out.println ( + "\t|| " + + FormatUtil.FormatDouble (oisTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor1MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor3MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor6MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor12MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (primeTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (municipalTenorSensitivity.get (tenor), 2, 2, 1.) + " ||" + ); + } + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println(); + } + + private static final void DisplayRiskMeasureAggregate ( + final RiskMeasureAggregateIR riskMeasureAggregateIR) + throws Exception + { + System.out.println ("\t||------------------------------------------------||"); + + System.out.println ("\t|| IR RISK CLASS AGGREGATE MARGIN METRICS ||"); + + System.out.println ("\t||------------------------------------------------||"); + + System.out.println ( + "\t|| Core Curvature SBA Variance => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.coreSBAVariance(), 10, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| Residual Curvature SBA Variance => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.residualSBAVariance(), 10, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| Curvature SBA => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.sba(), 10, 0, 1.) + " ||" + ); + + System.out.println ("\t||------------------------------------------------||"); + + System.out.println(); + } + + private static final void CurvatureMarginCovarianceEntry ( + final String currency, + final IRSensitivityAggregate irCurvatureAggregate) + throws Exception + { + double marginCovariance_OIS_OIS = irCurvatureAggregate.marginCovariance_OIS_OIS(); + + double marginCovariance_OIS_LIBOR1M = irCurvatureAggregate.marginCovariance_OIS_LIBOR1M(); + + double marginCovariance_OIS_LIBOR3M = irCurvatureAggregate.marginCovariance_OIS_LIBOR3M(); + + double marginCovariance_OIS_LIBOR6M = irCurvatureAggregate.marginCovariance_OIS_LIBOR6M(); + + double marginCovariance_OIS_LIBOR12M = irCurvatureAggregate.marginCovariance_OIS_LIBOR12M(); + + double marginCovariance_OIS_PRIME = irCurvatureAggregate.marginCovariance_OIS_PRIME(); + + double marginCovariance_OIS_MUNICIPAL = irCurvatureAggregate.marginCovariance_OIS_MUNICIPAL(); + + double marginCovariance_LIBOR1M_LIBOR1M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR1M(); + + double marginCovariance_LIBOR1M_LIBOR3M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR3M(); + + double marginCovariance_LIBOR1M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR6M(); + + double marginCovariance_LIBOR1M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR12M(); + + double marginCovariance_LIBOR1M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR1M_PRIME(); + + double marginCovariance_LIBOR1M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR1M_MUNICIPAL(); + + double marginCovariance_LIBOR3M_LIBOR3M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR3M(); + + double marginCovariance_LIBOR3M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR6M(); + + double marginCovariance_LIBOR3M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR12M(); + + double marginCovariance_LIBOR3M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR3M_PRIME(); + + double marginCovariance_LIBOR3M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR3M_MUNICIPAL(); + + double marginCovariance_LIBOR6M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR6M_LIBOR6M(); + + double marginCovariance_LIBOR6M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR6M_LIBOR12M(); + + double marginCovariance_LIBOR6M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR6M_PRIME(); + + double marginCovariance_LIBOR6M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR6M_MUNICIPAL(); + + double marginCovariance_LIBOR12M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR12M_LIBOR12M(); + + double marginCovariance_LIBOR12M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR12M_PRIME(); + + double marginCovariance_LIBOR12M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR12M_MUNICIPAL(); + + double marginCovariance_PRIME_PRIME = irCurvatureAggregate.marginCovariance_PRIME_PRIME(); + + double marginCovariance_PRIME_MUNICIPAL = irCurvatureAggregate.marginCovariance_PRIME_MUNICIPAL(); + + double marginCovariance_MUNICIPAL_MUNICIPAL = irCurvatureAggregate.marginCovariance_MUNICIPAL_MUNICIPAL(); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ("\t|| " + currency + " RISK FACTOR MARGIN COVARIANCE ||"); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ("\t|| ||"); + + System.out.println ("\t|| - L -> R: ||"); + + System.out.println ("\t|| - Curve #1 ||"); + + System.out.println ("\t|| - Curve #2 ||"); + + System.out.println ("\t|| - Covariance ||"); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| OIS - OIS => " + + FormatUtil.FormatDouble (marginCovariance_OIS_OIS, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR1M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR1M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_OIS_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_OIS_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR1M - LIBOR1M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR1M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR3M - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR6M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR12M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR12M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR12M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| PRIME - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_PRIME_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| PRIME - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_PRIME_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| MUNICIPAL - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_MUNICIPAL_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println(); + } + + public static final void main ( + final String[] inputArray) + throws Exception + { + EnvManager.InitEnv (""); + + double notional = 100.; + String currency = "USD"; + + List currencyList = new ArrayList(); + + currencyList.add (currency); + + RiskMeasureSensitivitySettingsIR riskMeasureSensitivitySettingsIR = + RiskMeasureSensitivitySettingsIR.ISDA_CURVATURE (currencyList); + + BucketSensitivityIR bucketSensitivityIR = new BucketSensitivityIR ( + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional) + ); + + DisplayBucketSensitivityIR ( + currency, + bucketSensitivityIR + ); + + Map bucketSensitivityMap = new HashMap(); + + bucketSensitivityMap.put ( + currency, + bucketSensitivityIR + ); + + RiskMeasureSensitivityIR riskClassSensitivityIR = new RiskMeasureSensitivityIR + (bucketSensitivityMap); + + RiskMeasureAggregateIR riskMeasureAggregateIR = riskClassSensitivityIR.curvatureAggregate + (riskMeasureSensitivitySettingsIR); + + CurvatureMarginCovarianceEntry ( + currency, + riskMeasureAggregateIR.bucketAggregateMap().get (currency).irSensitivityAggregate() + ); + + DisplayRiskMeasureAggregate (riskMeasureAggregateIR); + + EnvManager.TerminateEnv(); + } +} diff --git a/src/main/java/org/drip/sample/simm20estimates/IRCurrencyCurvatureMarginFlow.java b/src/main/java/org/drip/sample/simm20estimates/IRCurrencyCurvatureMarginFlow.java new file mode 100644 index 000000000000..ac5a241ebbbe --- /dev/null +++ b/src/main/java/org/drip/sample/simm20estimates/IRCurrencyCurvatureMarginFlow.java @@ -0,0 +1,543 @@ + +package org.drip.sample.simm20estimates; + +import java.util.HashMap; +import java.util.Map; + +import org.drip.quant.common.FormatUtil; +import org.drip.service.env.EnvManager; +import org.drip.simm20.margin.BucketAggregateIR; +import org.drip.simm20.margin.IRSensitivityAggregate; +import org.drip.simm20.margin.RiskMeasureAggregateIR; +import org.drip.simm20.parameters.BucketCurvatureSettingsIR; +import org.drip.simm20.product.BucketSensitivityIR; +import org.drip.simm20.product.RiskFactorTenorSensitivity; + +/* + * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + */ + +/*! + * Copyright (C) 2018 Lakshmi Krishnamurthy + * + * This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model + * libraries targeting analysts and developers + * https://lakshmidrip.github.io/DRIP/ + * + * DRIP is composed of four main libraries: + * + * - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/ + * - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/ + * - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/ + * - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/ + * + * - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options, + * Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA + * Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV + * Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM + * Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics. + * + * - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy + * Incorporator, Holdings Constraint, and Transaction Costs. + * + * - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality. + * + * - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * IRCurrencyCurvatureMarginFlow illustrates the Steps in the Computation of the IR Curvature Margin for a + * Currency Bucket's IR Exposure Sensitivities. The References are: + * + * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, + * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. + * + * - Albanese, C., S. Caenazzo, and O. Frankel (2017): Regression Sensitivities for Initial Margin + * Calculations, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2763488, eSSRN. + * + * - Anfuso, F., D. Aziz, P. Giltinan, and K. Loukopoulus (2017): A Sound Modeling and Back-testing + * Framework for Forecasting Initial Margin Requirements, + * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2716279, eSSRN. + * + * - Caspers, P., P. Giltinan, R. Lichters, and N. Nowaczyk (2017): Forecasting Initial Margin Requirements + * - A Model Evaluation https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2911167, eSSRN. + * + * - International Swaps and Derivatives Association (2017): SIMM v2.0 Methodology, + * https://www.isda.org/a/oFiDE/isda-simm-v2.pdf. + * + * @author Lakshmi Krishnamurthy + */ + +public class IRCurrencyCurvatureMarginFlow +{ + + private static final RiskFactorTenorSensitivity CurveTenorSensitivityMap ( + final double notional) + throws Exception + { + Map tenorSensitivityMap = new HashMap(); + + tenorSensitivityMap.put ( + "2W", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "1M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "3M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "6M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "1Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "2Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "3Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "5Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "10Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "15Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "20Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "30Y", + notional * (Math.random() - 0.5) + ); + + return new RiskFactorTenorSensitivity (tenorSensitivityMap); + } + + private static final void DisplayBucketSensitivityIR ( + final BucketSensitivityIR bucketSensitivityIR) + throws Exception + { + Map oisTenorSensitivity = bucketSensitivityIR.oisTenorSensitivity().sensitivityMap(); + + Map libor1MTenorSensitivity = + bucketSensitivityIR.libor1MTenorSensitivity().sensitivityMap(); + + Map libor3MTenorSensitivity = + bucketSensitivityIR.libor3MTenorSensitivity().sensitivityMap(); + + Map libor6MTenorSensitivity = + bucketSensitivityIR.libor6MTenorSensitivity().sensitivityMap(); + + Map libor12MTenorSensitivity = + bucketSensitivityIR.libor12MTenorSensitivity().sensitivityMap(); + + Map primeTenorSensitivity = + bucketSensitivityIR.primeTenorSensitivity().sensitivityMap(); + + Map municipalTenorSensitivity = + bucketSensitivityIR.municipalTenorSensitivity().sensitivityMap(); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| INTEREST CURVE TENOR SENSITIVITY ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| ||"); + + System.out.println ("\t|| L -> R: ||"); + + System.out.println ("\t|| - Curve Type ||"); + + System.out.println ("\t|| - OIS Tenor Delta Sensitivity ||"); + + System.out.println ("\t|| - LIBOR1M Tenor Delta Sensitivity ||"); + + System.out.println ("\t|| - LIBOR3M Tenor Delta Sensitivity ||"); + + System.out.println ("\t|| - LIBOR6M Tenor Delta Sensitivity ||"); + + System.out.println ("\t|| - LIBOR12M Tenor Delta Sensitivity ||"); + + System.out.println ("\t|| - PRIME Tenor Delta Sensitivity ||"); + + System.out.println ("\t|| - MUNICIPAL Tenor Delta Sensitivity ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| OIS | LIBOR1M | LIBOR3M | LIBOR6M | LIBOR12M | PRIME | MUNICIPAL ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + for (String tenor : oisTenorSensitivity.keySet()) + { + System.out.println ( + "\t|| " + + FormatUtil.FormatDouble (oisTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor1MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor3MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor6MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor12MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (primeTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (municipalTenorSensitivity.get (tenor), 2, 2, 1.) + " ||" + ); + } + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println(); + } + + private static final void CurvatureMarginCovarianceEntry ( + final IRSensitivityAggregate irCurvatureAggregate) + throws Exception + { + double marginCovariance_OIS_OIS = irCurvatureAggregate.marginCovariance_OIS_OIS(); + + double marginCovariance_OIS_LIBOR1M = irCurvatureAggregate.marginCovariance_OIS_LIBOR1M(); + + double marginCovariance_OIS_LIBOR3M = irCurvatureAggregate.marginCovariance_OIS_LIBOR3M(); + + double marginCovariance_OIS_LIBOR6M = irCurvatureAggregate.marginCovariance_OIS_LIBOR6M(); + + double marginCovariance_OIS_LIBOR12M = irCurvatureAggregate.marginCovariance_OIS_LIBOR12M(); + + double marginCovariance_OIS_PRIME = irCurvatureAggregate.marginCovariance_OIS_PRIME(); + + double marginCovariance_OIS_MUNICIPAL = irCurvatureAggregate.marginCovariance_OIS_MUNICIPAL(); + + double marginCovariance_LIBOR1M_LIBOR1M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR1M(); + + double marginCovariance_LIBOR1M_LIBOR3M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR3M(); + + double marginCovariance_LIBOR1M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR6M(); + + double marginCovariance_LIBOR1M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR12M(); + + double marginCovariance_LIBOR1M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR1M_PRIME(); + + double marginCovariance_LIBOR1M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR1M_MUNICIPAL(); + + double marginCovariance_LIBOR3M_LIBOR3M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR3M(); + + double marginCovariance_LIBOR3M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR6M(); + + double marginCovariance_LIBOR3M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR12M(); + + double marginCovariance_LIBOR3M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR3M_PRIME(); + + double marginCovariance_LIBOR3M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR3M_MUNICIPAL(); + + double marginCovariance_LIBOR6M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR6M_LIBOR6M(); + + double marginCovariance_LIBOR6M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR6M_LIBOR12M(); + + double marginCovariance_LIBOR6M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR6M_PRIME(); + + double marginCovariance_LIBOR6M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR6M_MUNICIPAL(); + + double marginCovariance_LIBOR12M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR12M_LIBOR12M(); + + double marginCovariance_LIBOR12M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR12M_PRIME(); + + double marginCovariance_LIBOR12M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR12M_MUNICIPAL(); + + double marginCovariance_PRIME_PRIME = irCurvatureAggregate.marginCovariance_PRIME_PRIME(); + + double marginCovariance_PRIME_MUNICIPAL = irCurvatureAggregate.marginCovariance_PRIME_MUNICIPAL(); + + double marginCovariance_MUNICIPAL_MUNICIPAL = irCurvatureAggregate.marginCovariance_MUNICIPAL_MUNICIPAL(); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ("\t|| IR RISK FACTOR MARGIN COVARIANCE ||"); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ("\t|| ||"); + + System.out.println ("\t|| - L -> R: ||"); + + System.out.println ("\t|| - Curve #1 ||"); + + System.out.println ("\t|| - Curve #2 ||"); + + System.out.println ("\t|| - Covariance ||"); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| OIS - OIS => " + + FormatUtil.FormatDouble (marginCovariance_OIS_OIS, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR1M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR1M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_OIS_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_OIS_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR1M - LIBOR1M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR1M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR3M - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR6M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR12M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR12M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR12M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| PRIME - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_PRIME_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| PRIME - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_PRIME_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| MUNICIPAL - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_MUNICIPAL_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println(); + } + + private static final void DisplayRiskMeasureAggregate ( + final RiskMeasureAggregateIR riskMeasureAggregateIR) + throws Exception + { + System.out.println ("\t||------------------------------------------------||"); + + System.out.println ("\t|| IR RISK CLASS AGGREGATE MARGIN METRICS ||"); + + System.out.println ("\t||------------------------------------------------||"); + + System.out.println ( + "\t|| Core Curvature SBA Variance => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.coreSBAVariance(), 10, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| Residual Curvature SBA Variance => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.residualSBAVariance(), 10, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| Curvature SBA => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.sba(), 10, 0, 1.) + " ||" + ); + + System.out.println ("\t||------------------------------------------------||"); + + System.out.println(); + } + + public static final void main ( + final String[] inputArray) + throws Exception + { + EnvManager.InitEnv (""); + + double notional = 100.; + String currency = "USD"; + + BucketCurvatureSettingsIR bucketCurvatureSettingsIR = BucketCurvatureSettingsIR.ISDA (currency); + + BucketSensitivityIR bucketSensitivityIR = new BucketSensitivityIR ( + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional) + ); + + DisplayBucketSensitivityIR (bucketSensitivityIR); + + BucketAggregateIR bucketAggregateIR = bucketSensitivityIR.aggregate (bucketCurvatureSettingsIR); + + IRSensitivityAggregate irCurvatureAggregate = + bucketAggregateIR.riskFactorAggregateIR().curvatureMargin (bucketCurvatureSettingsIR); + + CurvatureMarginCovarianceEntry (irCurvatureAggregate); + + Map bucketAggregateIRMap = new HashMap(); + + bucketAggregateIRMap.put ( + currency, + bucketAggregateIR + ); + + RiskMeasureAggregateIR riskMeasureAggregateIR = new RiskMeasureAggregateIR ( + bucketAggregateIRMap, + irCurvatureAggregate.cumulativeMarginCovariance(), + 0. + ); + + DisplayRiskMeasureAggregate (riskMeasureAggregateIR); + + EnvManager.TerminateEnv(); + } +} diff --git a/src/main/java/org/drip/sample/simm20estimates/IRCurvatureMargin.java b/src/main/java/org/drip/sample/simm20estimates/IRCurvatureMargin.java new file mode 100644 index 000000000000..e4f4eb98d1b1 --- /dev/null +++ b/src/main/java/org/drip/sample/simm20estimates/IRCurvatureMargin.java @@ -0,0 +1,586 @@ + +package org.drip.sample.simm20estimates; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.drip.quant.common.FormatUtil; +import org.drip.service.env.EnvManager; +import org.drip.simm20.margin.IRSensitivityAggregate; +import org.drip.simm20.margin.RiskMeasureAggregateIR; +import org.drip.simm20.parameters.RiskMeasureSensitivitySettingsIR; +import org.drip.simm20.product.BucketSensitivityIR; +import org.drip.simm20.product.RiskFactorTenorSensitivity; +import org.drip.simm20.product.RiskMeasureSensitivityIR; + +/* + * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + */ + +/*! + * Copyright (C) 2018 Lakshmi Krishnamurthy + * + * This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model + * libraries targeting analysts and developers + * https://lakshmidrip.github.io/DRIP/ + * + * DRIP is composed of four main libraries: + * + * - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/ + * - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/ + * - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/ + * - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/ + * + * - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options, + * Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA + * Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV + * Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM + * Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics. + * + * - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy + * Incorporator, Holdings Constraint, and Transaction Costs. + * + * - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality. + * + * - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * IRCurvatureMargin illustrates the Computation of the IR Curvature Margin for a Bucket of Currency's IR + * Exposure Sensitivities. The References are: + * + * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, + * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. + * + * - Albanese, C., S. Caenazzo, and O. Frankel (2017): Regression Sensitivities for Initial Margin + * Calculations, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2763488, eSSRN. + * + * - Anfuso, F., D. Aziz, P. Giltinan, and K. Loukopoulus (2017): A Sound Modeling and Back-testing + * Framework for Forecasting Initial Margin Requirements, + * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2716279, eSSRN. + * + * - Caspers, P., P. Giltinan, R. Lichters, and N. Nowaczyk (2017): Forecasting Initial Margin Requirements + * - A Model Evaluation https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2911167, eSSRN. + * + * - International Swaps and Derivatives Association (2017): SIMM v2.0 Methodology, + * https://www.isda.org/a/oFiDE/isda-simm-v2.pdf. + * + * @author Lakshmi Krishnamurthy + */ + +public class IRCurvatureMargin +{ + + private static final RiskFactorTenorSensitivity CurveTenorSensitivityMap ( + final double notional) + throws Exception + { + Map tenorSensitivityMap = new HashMap(); + + tenorSensitivityMap.put ( + "2W", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "1M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "3M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "6M", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "1Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "2Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "3Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "5Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "10Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "15Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "20Y", + notional * (Math.random() - 0.5) + ); + + tenorSensitivityMap.put ( + "30Y", + notional * (Math.random() - 0.5) + ); + + return new RiskFactorTenorSensitivity (tenorSensitivityMap); + } + + private static final void DisplayBucketSensitivityIR ( + final String currency, + final BucketSensitivityIR bucketSensitivityIR) + throws Exception + { + Map oisTenorSensitivity = bucketSensitivityIR.oisTenorSensitivity().sensitivityMap(); + + Map libor1MTenorSensitivity = + bucketSensitivityIR.libor1MTenorSensitivity().sensitivityMap(); + + Map libor3MTenorSensitivity = + bucketSensitivityIR.libor3MTenorSensitivity().sensitivityMap(); + + Map libor6MTenorSensitivity = + bucketSensitivityIR.libor6MTenorSensitivity().sensitivityMap(); + + Map libor12MTenorSensitivity = + bucketSensitivityIR.libor12MTenorSensitivity().sensitivityMap(); + + Map primeTenorSensitivity = + bucketSensitivityIR.primeTenorSensitivity().sensitivityMap(); + + Map municipalTenorSensitivity = + bucketSensitivityIR.municipalTenorSensitivity().sensitivityMap(); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| " + currency + " INTEREST CURVE TENOR SENSITIVITY ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| ||"); + + System.out.println ("\t|| L -> R: ||"); + + System.out.println ("\t|| - Curve Type ||"); + + System.out.println ("\t|| - OIS Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR1M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR3M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR6M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - LIBOR12M Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - PRIME Tenor Curvature Sensitivity ||"); + + System.out.println ("\t|| - MUNICIPAL Tenor Curvature Sensitivity ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println ("\t|| OIS | LIBOR1M | LIBOR3M | LIBOR6M | LIBOR12M | PRIME | MUNICIPAL ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + for (String tenor : oisTenorSensitivity.keySet()) + { + System.out.println ( + "\t|| " + + FormatUtil.FormatDouble (oisTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor1MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor3MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor6MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (libor12MTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (primeTenorSensitivity.get (tenor), 2, 2, 1.) + " | " + + FormatUtil.FormatDouble (municipalTenorSensitivity.get (tenor), 2, 2, 1.) + " ||" + ); + } + + System.out.println ("\t||-----------------------------------------------------------------------------------------||"); + + System.out.println(); + } + + private static final void CurvatureMarginCovarianceEntry ( + final String currency, + final IRSensitivityAggregate irCurvatureAggregate) + throws Exception + { + double marginCovariance_OIS_OIS = irCurvatureAggregate.marginCovariance_OIS_OIS(); + + double marginCovariance_OIS_LIBOR1M = irCurvatureAggregate.marginCovariance_OIS_LIBOR1M(); + + double marginCovariance_OIS_LIBOR3M = irCurvatureAggregate.marginCovariance_OIS_LIBOR3M(); + + double marginCovariance_OIS_LIBOR6M = irCurvatureAggregate.marginCovariance_OIS_LIBOR6M(); + + double marginCovariance_OIS_LIBOR12M = irCurvatureAggregate.marginCovariance_OIS_LIBOR12M(); + + double marginCovariance_OIS_PRIME = irCurvatureAggregate.marginCovariance_OIS_PRIME(); + + double marginCovariance_OIS_MUNICIPAL = irCurvatureAggregate.marginCovariance_OIS_MUNICIPAL(); + + double marginCovariance_LIBOR1M_LIBOR1M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR1M(); + + double marginCovariance_LIBOR1M_LIBOR3M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR3M(); + + double marginCovariance_LIBOR1M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR6M(); + + double marginCovariance_LIBOR1M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR1M_LIBOR12M(); + + double marginCovariance_LIBOR1M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR1M_PRIME(); + + double marginCovariance_LIBOR1M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR1M_MUNICIPAL(); + + double marginCovariance_LIBOR3M_LIBOR3M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR3M(); + + double marginCovariance_LIBOR3M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR6M(); + + double marginCovariance_LIBOR3M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR3M_LIBOR12M(); + + double marginCovariance_LIBOR3M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR3M_PRIME(); + + double marginCovariance_LIBOR3M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR3M_MUNICIPAL(); + + double marginCovariance_LIBOR6M_LIBOR6M = irCurvatureAggregate.marginCovariance_LIBOR6M_LIBOR6M(); + + double marginCovariance_LIBOR6M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR6M_LIBOR12M(); + + double marginCovariance_LIBOR6M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR6M_PRIME(); + + double marginCovariance_LIBOR6M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR6M_MUNICIPAL(); + + double marginCovariance_LIBOR12M_LIBOR12M = irCurvatureAggregate.marginCovariance_LIBOR12M_LIBOR12M(); + + double marginCovariance_LIBOR12M_PRIME = irCurvatureAggregate.marginCovariance_LIBOR12M_PRIME(); + + double marginCovariance_LIBOR12M_MUNICIPAL = irCurvatureAggregate.marginCovariance_LIBOR12M_MUNICIPAL(); + + double marginCovariance_PRIME_PRIME = irCurvatureAggregate.marginCovariance_PRIME_PRIME(); + + double marginCovariance_PRIME_MUNICIPAL = irCurvatureAggregate.marginCovariance_PRIME_MUNICIPAL(); + + double marginCovariance_MUNICIPAL_MUNICIPAL = irCurvatureAggregate.marginCovariance_MUNICIPAL_MUNICIPAL(); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ("\t|| " + currency + " RISK FACTOR MARGIN COVARIANCE ||"); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ("\t|| ||"); + + System.out.println ("\t|| - L -> R: ||"); + + System.out.println ("\t|| - Curve #1 ||"); + + System.out.println ("\t|| - Curve #2 ||"); + + System.out.println ("\t|| - Covariance ||"); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| OIS - OIS => " + + FormatUtil.FormatDouble (marginCovariance_OIS_OIS, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR1M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR1M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_OIS_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_OIS_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| OIS - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_OIS_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR1M - LIBOR1M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR1M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR1M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR1M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR3M - LIBOR3M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR3M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR3M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR3M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR6M - LIBOR6M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_LIBOR6M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR6M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR6M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| LIBOR12M - LIBOR12M => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_LIBOR12M, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR12M - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| LIBOR12M - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_LIBOR12M_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| PRIME - PRIME => " + + FormatUtil.FormatDouble (marginCovariance_PRIME_PRIME, 9, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| PRIME - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_PRIME_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println ( + "\t|| MUNICIPAL - MUNICIPAL => " + + FormatUtil.FormatDouble (marginCovariance_MUNICIPAL_MUNICIPAL, 9, 0, 1.) + " ||" + ); + + System.out.println ("\t||-------------------------------------||"); + + System.out.println(); + } + + private static final BucketSensitivityIR CurrencyBucketSensitivity ( + final String currency, + final double notional) + throws Exception + { + BucketSensitivityIR bucketSensitivityIR = new BucketSensitivityIR ( + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional), + CurveTenorSensitivityMap (notional) + ); + + DisplayBucketSensitivityIR ( + currency, + bucketSensitivityIR + ); + + return bucketSensitivityIR; + } + + private static final void DisplayRiskMeasureAggregate ( + final RiskMeasureAggregateIR riskMeasureAggregateIR) + throws Exception + { + System.out.println ("\t||------------------------------------------------||"); + + System.out.println ("\t|| IR RISK CLASS AGGREGATE MARGIN METRICS ||"); + + System.out.println ("\t||------------------------------------------------||"); + + System.out.println ( + "\t|| Core Curvature SBA Variance => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.coreSBAVariance(), 10, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| Residual Curvature SBA Variance => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.residualSBAVariance(), 10, 0, 1.) + " ||" + ); + + System.out.println ( + "\t|| Curvature SBA => " + + FormatUtil.FormatDouble (riskMeasureAggregateIR.sba(), 10, 0, 1.) + " ||" + ); + + System.out.println ("\t||------------------------------------------------||"); + + System.out.println(); + } + + public static final void main ( + final String[] inputs) + throws Exception + { + EnvManager.InitEnv (""); + + String[] currencyArray = { + "USD", + "EUR", + "CNY", + "INR", + "JPY" + }; + + double[] notionalArray = { + 100., + 108., + 119., + 49., + 28. + }; + + Map bucketSensitivityMap = new HashMap(); + + for (int currencyIndex = 0; currencyIndex < currencyArray.length; ++currencyIndex) + { + bucketSensitivityMap.put ( + currencyArray[currencyIndex], + CurrencyBucketSensitivity ( + currencyArray[currencyIndex], + notionalArray[currencyIndex] + ) + ); + } + + List currencyList = new ArrayList(); + + for (String currency : currencyArray) + { + currencyList.add (currency); + } + + RiskMeasureSensitivityIR riskClassSensitivityIR = new RiskMeasureSensitivityIR + (bucketSensitivityMap); + + RiskMeasureSensitivitySettingsIR riskMeasureSensitivitySettingsIR = + RiskMeasureSensitivitySettingsIR.ISDA_CURVATURE (currencyList); + + RiskMeasureAggregateIR riskMeasureAggregateIR = riskClassSensitivityIR.curvatureAggregate + (riskMeasureSensitivitySettingsIR); + + for (String currency : currencyArray) + { + CurvatureMarginCovarianceEntry ( + currency, + riskMeasureAggregateIR.bucketAggregateMap().get (currency).irSensitivityAggregate() + ); + } + + DisplayRiskMeasureAggregate (riskMeasureAggregateIR); + + EnvManager.TerminateEnv(); + } +} diff --git a/src/main/java/org/drip/sample/simm20settings/package-info.java b/src/main/java/org/drip/sample/simm20settings/package-info.java deleted file mode 100644 index 141c66e38fb7..000000000000 --- a/src/main/java/org/drip/sample/simm20settings/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ - -/** - * ISDA SIMM 2.0 Parameter Settings - * - * @author Lakshmi Krishnamurthy - */ - -package org.drip.sample.simm20settings; diff --git a/src/main/java/org/drip/sample/simm20estimates/CTCurvatureMargin.java b/src/main/java/org/drip/sample/simmct/CommodityCurvatureMargin20.java similarity index 97% rename from src/main/java/org/drip/sample/simm20estimates/CTCurvatureMargin.java rename to src/main/java/org/drip/sample/simmct/CommodityCurvatureMargin20.java index 9c78af84809e..4785684ed7a0 100644 --- a/src/main/java/org/drip/sample/simm20estimates/CTCurvatureMargin.java +++ b/src/main/java/org/drip/sample/simmct/CommodityCurvatureMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmct; import java.util.HashMap; import java.util.Map; @@ -59,8 +59,8 @@ */ /** - * CTCurvatureMargin illustrates the Computation of the CT Curvature Margin for across a Group of Commodity - * Bucket Exposure Sensitivities. The References are: + * CommodityCurvatureMargin20 illustrates the Computation of the SIMM Curvature Margin for across a Group of + * Commodity Bucket Exposure Sensitivities. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class CTCurvatureMargin +public class CommodityCurvatureMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simm20estimates/CTDeltaMargin.java b/src/main/java/org/drip/sample/simmct/CommodityDeltaMargin20.java similarity index 98% rename from src/main/java/org/drip/sample/simm20estimates/CTDeltaMargin.java rename to src/main/java/org/drip/sample/simmct/CommodityDeltaMargin20.java index 151c6e0f0aab..ff37d53bb333 100644 --- a/src/main/java/org/drip/sample/simm20estimates/CTDeltaMargin.java +++ b/src/main/java/org/drip/sample/simmct/CommodityDeltaMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmct; import java.util.Map; import java.util.HashMap; @@ -59,8 +59,8 @@ */ /** - * CTDeltaMargin illustrates the Computation of the CT Delta Margin for across a Group of Commodity Bucket - * Exposure Sensitivities. The References are: + * CommodityDeltaMargin20 illustrates the Computation of the ISDA 2.0 Delta Margin for across a Group of + * Commodity Bucket Exposure Sensitivities. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class CTDeltaMargin +public class CommodityDeltaMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simm20estimates/CTVegaMargin.java b/src/main/java/org/drip/sample/simmct/CommodityVegaMargin20.java similarity index 98% rename from src/main/java/org/drip/sample/simm20estimates/CTVegaMargin.java rename to src/main/java/org/drip/sample/simmct/CommodityVegaMargin20.java index 3ebbc4decd46..927c4232dd69 100644 --- a/src/main/java/org/drip/sample/simm20estimates/CTVegaMargin.java +++ b/src/main/java/org/drip/sample/simmct/CommodityVegaMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmct; import java.util.HashMap; import java.util.Map; @@ -59,8 +59,8 @@ */ /** - * CTVegaMargin illustrates the Computation of the CT Vega Margin for across a Group of Commodity Bucket - * Exposure Sensitivities. The References are: + * CommodityVegaMargin20 illustrates the Computation of the SIMM Vega Margin for across a Group of Commodity + * Bucket Exposure Sensitivities. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class CTVegaMargin +public class CommodityVegaMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simmct/package-info.java b/src/main/java/org/drip/sample/simmct/package-info.java new file mode 100644 index 000000000000..87502ea51055 --- /dev/null +++ b/src/main/java/org/drip/sample/simmct/package-info.java @@ -0,0 +1,8 @@ + +/** + * ISDA SIMM Commodity Estimate Runs + * + * @author Lakshmi Krishnamurthy + */ + +package org.drip.sample.simmct; diff --git a/src/main/java/org/drip/sample/simm20estimates/EQCurvatureMargin.java b/src/main/java/org/drip/sample/simmeq/EquityCurvatureMargin20.java similarity index 98% rename from src/main/java/org/drip/sample/simm20estimates/EQCurvatureMargin.java rename to src/main/java/org/drip/sample/simmeq/EquityCurvatureMargin20.java index ec0926717d60..0ca514629725 100644 --- a/src/main/java/org/drip/sample/simm20estimates/EQCurvatureMargin.java +++ b/src/main/java/org/drip/sample/simmeq/EquityCurvatureMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmeq; import java.util.Map; import java.util.TreeMap; @@ -59,7 +59,7 @@ */ /** - * EQCurvatureMargin illustrates the Computation of the EQ Curvature Margin for across a Group of Equity + * EquityCurvatureMargin20 illustrates the Computation of the SIMM 2.0 Curvature Margin for a Group of Equity * Bucket Exposure Sensitivities. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class EQCurvatureMargin +public class EquityCurvatureMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simm20estimates/EQDeltaMargin.java b/src/main/java/org/drip/sample/simmeq/EquityDeltaMargin20.java similarity index 98% rename from src/main/java/org/drip/sample/simm20estimates/EQDeltaMargin.java rename to src/main/java/org/drip/sample/simmeq/EquityDeltaMargin20.java index a70d364da9aa..a8a01fbcc882 100644 --- a/src/main/java/org/drip/sample/simm20estimates/EQDeltaMargin.java +++ b/src/main/java/org/drip/sample/simmeq/EquityDeltaMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmeq; import java.util.Map; import java.util.TreeMap; @@ -59,8 +59,8 @@ */ /** - * EQDeltaMargin illustrates the Computation of the EQ Delta Margin for across a Group of Equity Bucket - * Exposure Sensitivities. The References are: + * EquityDeltaMargin20 illustrates the Computation of the SIMM 2.0 Delta Margin across a Group of Equity + * Bucket Exposure Sensitivities. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class EQDeltaMargin +public class EquityDeltaMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simm20estimates/EQVegaMargin.java b/src/main/java/org/drip/sample/simmeq/EquityVegaMargin20.java similarity index 98% rename from src/main/java/org/drip/sample/simm20estimates/EQVegaMargin.java rename to src/main/java/org/drip/sample/simmeq/EquityVegaMargin20.java index 53b6b65b0e79..cff0d563b821 100644 --- a/src/main/java/org/drip/sample/simm20estimates/EQVegaMargin.java +++ b/src/main/java/org/drip/sample/simmeq/EquityVegaMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmeq; import java.util.Map; import java.util.TreeMap; @@ -59,7 +59,7 @@ */ /** - * EQVegaMargin illustrates the Computation of the EQ Vega Margin for across a Group of Equity Bucket + * EquityVegaMargin20 illustrates the Computation of the SIMM 2.0 Vega Margin across a Group of Equity Bucket * Exposure Sensitivities. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class EQVegaMargin +public class EquityVegaMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simmeq/package-info.java b/src/main/java/org/drip/sample/simmeq/package-info.java new file mode 100644 index 000000000000..a13b2f5b1000 --- /dev/null +++ b/src/main/java/org/drip/sample/simmeq/package-info.java @@ -0,0 +1,8 @@ + +/** + * ISDA SIMM Equity Estimate Runs + * + * @author Lakshmi Krishnamurthy + */ + +package org.drip.sample.simmeq; diff --git a/src/main/java/org/drip/sample/simm20estimates/FXCurvatureMargin.java b/src/main/java/org/drip/sample/simmfx/FXCurvatureMargin20.java similarity index 97% rename from src/main/java/org/drip/sample/simm20estimates/FXCurvatureMargin.java rename to src/main/java/org/drip/sample/simmfx/FXCurvatureMargin20.java index 8e519f659a4e..467a7e7b3a47 100644 --- a/src/main/java/org/drip/sample/simm20estimates/FXCurvatureMargin.java +++ b/src/main/java/org/drip/sample/simmfx/FXCurvatureMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmfx; import java.util.Map; import java.util.TreeMap; @@ -59,8 +59,8 @@ */ /** - * FXCurvatureMargin demonstrates the Construction of a Portfolio of FX Curvature Sensitivities and their - * eventual SIMM Initial Margin Computation. The References are: + * FXCurvatureMargin20 demonstrates the Construction of a Portfolio of FX Curvature Sensitivities and their + * eventual SIMM 2.0 Margin Computation. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class FXCurvatureMargin +public class FXCurvatureMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simm20estimates/FXDeltaMargin.java b/src/main/java/org/drip/sample/simmfx/FXDeltaMargin20.java similarity index 97% rename from src/main/java/org/drip/sample/simm20estimates/FXDeltaMargin.java rename to src/main/java/org/drip/sample/simmfx/FXDeltaMargin20.java index 9bdf7003171b..8ba9c31df0a9 100644 --- a/src/main/java/org/drip/sample/simm20estimates/FXDeltaMargin.java +++ b/src/main/java/org/drip/sample/simmfx/FXDeltaMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmfx; import java.util.Map; import java.util.TreeMap; @@ -60,8 +60,8 @@ */ /** - * FXDeltaMargin demonstrates the Construction of a Portfolio of FX Delta Sensitivities and their eventual - * SIMM Initial Margin Computation. The References are: + * FXDeltaMargin20 demonstrates the Construction of a Portfolio of FX Delta Sensitivities and their eventual + * SIMM 2.0 Margin Computation. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -82,7 +82,7 @@ * @author Lakshmi Krishnamurthy */ -public class FXDeltaMargin +public class FXDeltaMargin20 { private static final Map> CategorySensitivityMap ( diff --git a/src/main/java/org/drip/sample/simm20estimates/FXVegaMargin.java b/src/main/java/org/drip/sample/simmfx/FXVegaMargin20.java similarity index 97% rename from src/main/java/org/drip/sample/simm20estimates/FXVegaMargin.java rename to src/main/java/org/drip/sample/simmfx/FXVegaMargin20.java index 2eee466531ad..5ac86067fd79 100644 --- a/src/main/java/org/drip/sample/simm20estimates/FXVegaMargin.java +++ b/src/main/java/org/drip/sample/simmfx/FXVegaMargin20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20estimates; +package org.drip.sample.simmfx; import java.util.Map; import java.util.TreeMap; @@ -59,8 +59,8 @@ */ /** - * FXVegaMargin demonstrates the Construction of a Portfolio of FX Vega Sensitivities and their eventual SIMM - * Initial Margin Computation. The References are: + * FXVegaMargin20 demonstrates the Construction of a Portfolio of FX Vega Sensitivities and their eventual + * SIMM 2.0 Margin Computation. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -81,7 +81,7 @@ * @author Lakshmi Krishnamurthy */ -public class FXVegaMargin +public class FXVegaMargin20 { private static final void AddBucketRiskFactorSensitivity ( diff --git a/src/main/java/org/drip/sample/simmfx/package-info.java b/src/main/java/org/drip/sample/simmfx/package-info.java new file mode 100644 index 000000000000..2913a688dac0 --- /dev/null +++ b/src/main/java/org/drip/sample/simmfx/package-info.java @@ -0,0 +1,8 @@ + +/** + * ISDA SIMM FX Estimate Runs + * + * @author Lakshmi Krishnamurthy + */ + +package org.drip.sample.simmfx; diff --git a/src/main/java/org/drip/sample/simm20settings/CommodityRiskConcentrationThreshold.java b/src/main/java/org/drip/sample/simmsettings/CommodityRiskConcentrationThreshold20.java similarity index 94% rename from src/main/java/org/drip/sample/simm20settings/CommodityRiskConcentrationThreshold.java rename to src/main/java/org/drip/sample/simmsettings/CommodityRiskConcentrationThreshold20.java index db10f5e9a24a..de51b026516b 100644 --- a/src/main/java/org/drip/sample/simm20settings/CommodityRiskConcentrationThreshold.java +++ b/src/main/java/org/drip/sample/simmsettings/CommodityRiskConcentrationThreshold20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.Set; @@ -54,7 +54,7 @@ */ /** - * CommodityRiskConcentrationThreshold demonstrates the Extraction and Display of ISDA SIMM 2.0 Commodity + * CommodityRiskConcentrationThreshold20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Commodity * Risk Concentration Thresholds. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -76,7 +76,7 @@ * @author Lakshmi Krishnamurthy */ -public class CommodityRiskConcentrationThreshold +public class CommodityRiskConcentrationThreshold20 { private static final void DisplayBuckets() @@ -86,7 +86,7 @@ private static final void DisplayBuckets() System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); - System.out.println ("\t|| COMMODITY RISK CONCENTRATION THRESHOLD ||"); + System.out.println ("\t|| 2.0 COMMODITY RISK CONCENTRATION THRESHOLD ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/CommoditySettings.java b/src/main/java/org/drip/sample/simmsettings/CommoditySettings20.java similarity index 95% rename from src/main/java/org/drip/sample/simm20settings/CommoditySettings.java rename to src/main/java/org/drip/sample/simmsettings/CommoditySettings20.java index 60b9d372774b..cc3d0d7b9117 100644 --- a/src/main/java/org/drip/sample/simm20settings/CommoditySettings.java +++ b/src/main/java/org/drip/sample/simmsettings/CommoditySettings20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.List; import java.util.Set; @@ -57,8 +57,8 @@ */ /** - * CommoditySettings demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency Commodity - * Bucket Risk Weights, Correlations, and Systemics. The References are: + * CommoditySettings20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency + * Commodity Bucket Risk Weights, Correlations, and Systemics. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -79,7 +79,7 @@ * @author Lakshmi Krishnamurthy */ -public class CommoditySettings +public class CommoditySettings20 { private static final void RiskWeights() @@ -90,7 +90,7 @@ private static final void RiskWeights() ("\t||-------------------------------------------------------------------------------------------------------------||"); System.out.println - ("\t|| COMMODITY BUCKETS RISK WEIGHT ||"); + ("\t|| 2.0 COMMODITY BUCKETS RISK WEIGHT ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/CreditNonQualifyingSettings.java b/src/main/java/org/drip/sample/simmsettings/CreditNonQualifyingSettings20.java similarity index 94% rename from src/main/java/org/drip/sample/simm20settings/CreditNonQualifyingSettings.java rename to src/main/java/org/drip/sample/simmsettings/CreditNonQualifyingSettings20.java index 330d8dc8d6f6..4e701ca46233 100644 --- a/src/main/java/org/drip/sample/simm20settings/CreditNonQualifyingSettings.java +++ b/src/main/java/org/drip/sample/simmsettings/CreditNonQualifyingSettings20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.Set; @@ -56,8 +56,8 @@ */ /** - * CreditNonQualifyingSettings demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency - * Credit Non-Qualifying Bucket Risk Weights, Systemics, and Correlations. The References are: + * CreditNonQualifyingSettings20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross + * Currency Credit Non-Qualifying Bucket Risk Weights, Systemics, and Correlations. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -78,7 +78,7 @@ * @author Lakshmi Krishnamurthy */ -public class CreditNonQualifyingSettings +public class CreditNonQualifyingSettings20 { private static final void DisplayRiskWeights() @@ -89,7 +89,7 @@ private static final void DisplayRiskWeights() ("\t||-------------------------------------------------------------------------------------------------------------||"); System.out.println - ("\t|| CREDIT NON QUALIFYING BUCKETS RISK WEIGHT ||"); + ("\t|| 2.0 CREDIT NON QUALIFYING BUCKETS RISK WEIGHT ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/CreditQualifyingSettings.java b/src/main/java/org/drip/sample/simmsettings/CreditQualifyingSettings20.java similarity index 96% rename from src/main/java/org/drip/sample/simm20settings/CreditQualifyingSettings.java rename to src/main/java/org/drip/sample/simmsettings/CreditQualifyingSettings20.java index d1cfb864c0ef..28fbf418fd88 100644 --- a/src/main/java/org/drip/sample/simm20settings/CreditQualifyingSettings.java +++ b/src/main/java/org/drip/sample/simmsettings/CreditQualifyingSettings20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.List; import java.util.Set; @@ -58,7 +58,7 @@ */ /** - * CreditQualifyingSettings demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency + * CreditQualifyingSettings20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency * Credit Qualifying Bucket Risk Weights, Systemics, and Correlations. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -80,7 +80,7 @@ * @author Lakshmi Krishnamurthy */ -public class CreditQualifyingSettings +public class CreditQualifyingSettings20 { private static final void RiskWeights() @@ -91,7 +91,7 @@ private static final void RiskWeights() ("\t||-------------------------------------------------------------------------------------------------------------||"); System.out.println - ("\t|| CREDIT QUALIFYING BUCKETS RISK WEIGHT ||"); + ("\t|| 2.0 CREDIT QUALIFYING BUCKETS RISK WEIGHT ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/CreditRiskConcentrationThreshold.java b/src/main/java/org/drip/sample/simmsettings/CreditRiskConcentrationThreshold20.java similarity index 94% rename from src/main/java/org/drip/sample/simm20settings/CreditRiskConcentrationThreshold.java rename to src/main/java/org/drip/sample/simmsettings/CreditRiskConcentrationThreshold20.java index ba36d1541fca..08d125b414d4 100644 --- a/src/main/java/org/drip/sample/simm20settings/CreditRiskConcentrationThreshold.java +++ b/src/main/java/org/drip/sample/simmsettings/CreditRiskConcentrationThreshold20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.Set; @@ -54,7 +54,7 @@ */ /** - * CreditRiskConcentrationThreshold demonstrates the Extraction and Display of ISDA SIMM 2.0 Credit Risk + * CreditRiskConcentrationThreshold20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Credit Risk * Concentration Thresholds. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -76,7 +76,7 @@ * @author Lakshmi Krishnamurthy */ -public class CreditRiskConcentrationThreshold +public class CreditRiskConcentrationThreshold20 { private static final void DisplayQualifyingBuckets() @@ -86,7 +86,7 @@ private static final void DisplayQualifyingBuckets() System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); - System.out.println ("\t|| QUALIFYING CREDIT RISK CONCENTRATION THRESHOLD ||"); + System.out.println ("\t|| 2.0 QUALIFYING CREDIT RISK CONCENTRATION THRESHOLD ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); @@ -124,7 +124,7 @@ private static final void DisplayNonQualifyingBuckets() System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); - System.out.println ("\t|| NON-QUALIFYING CREDIT RISK CONCENTRATION THRESHOLD ||"); + System.out.println ("\t|| 2.0 NON-QUALIFYING CREDIT RISK CONCENTRATION THRESHOLD ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/EquityRiskConcentrationThreshold.java b/src/main/java/org/drip/sample/simmsettings/EquityRiskConcentrationThreshold20.java similarity index 94% rename from src/main/java/org/drip/sample/simm20settings/EquityRiskConcentrationThreshold.java rename to src/main/java/org/drip/sample/simmsettings/EquityRiskConcentrationThreshold20.java index fe97946a0ca6..7a042d0ead17 100644 --- a/src/main/java/org/drip/sample/simm20settings/EquityRiskConcentrationThreshold.java +++ b/src/main/java/org/drip/sample/simmsettings/EquityRiskConcentrationThreshold20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.Set; @@ -54,7 +54,7 @@ */ /** - * EquityRiskConcentrationThreshold demonstrates the Extraction and Display of ISDA SIMM 2.0 Equity Risk + * EquityRiskConcentrationThreshold20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Equity Risk * Concentration Thresholds. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -76,7 +76,7 @@ * @author Lakshmi Krishnamurthy */ -public class EquityRiskConcentrationThreshold +public class EquityRiskConcentrationThreshold20 { private static final void DisplayBuckets() @@ -86,7 +86,7 @@ private static final void DisplayBuckets() System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); - System.out.println ("\t|| EQUITY RISK CONCENTRATION THRESHOLD ||"); + System.out.println ("\t|| 2.0 EQUITY RISK CONCENTRATION THRESHOLD ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/EquitySettings.java b/src/main/java/org/drip/sample/simmsettings/EquitySettings20.java similarity index 96% rename from src/main/java/org/drip/sample/simm20settings/EquitySettings.java rename to src/main/java/org/drip/sample/simmsettings/EquitySettings20.java index 17a06b850ecb..7f682c3a261e 100644 --- a/src/main/java/org/drip/sample/simm20settings/EquitySettings.java +++ b/src/main/java/org/drip/sample/simmsettings/EquitySettings20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.List; import java.util.Set; @@ -57,7 +57,7 @@ */ /** - * EquitySettings demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency Equity + * EquitySettings20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency Equity * Bucket Risk Weights, Correlations, and Systemics. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -79,7 +79,7 @@ * @author Lakshmi Krishnamurthy */ -public class EquitySettings +public class EquitySettings20 { private static final void RiskWeights() @@ -90,7 +90,7 @@ private static final void RiskWeights() ("\t||-------------------------------------------------------------------------------------------------------------||"); System.out.println - ("\t|| EQUITY BUCKETS RISK WEIGHT ||"); + ("\t|| 2.0 EQUITY BUCKETS RISK WEIGHT ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/FXSettings.java b/src/main/java/org/drip/sample/simmsettings/FXSettings20.java similarity index 93% rename from src/main/java/org/drip/sample/simm20settings/FXSettings.java rename to src/main/java/org/drip/sample/simmsettings/FXSettings20.java index 34c5bf447cef..76dc0f4becf4 100644 --- a/src/main/java/org/drip/sample/simm20settings/FXSettings.java +++ b/src/main/java/org/drip/sample/simmsettings/FXSettings20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import org.drip.quant.common.FormatUtil; import org.drip.service.env.EnvManager; @@ -51,8 +51,8 @@ */ /** - * FXSettings demonstrates the Extraction and Display of ISDA SIMM 2.0 FX Bucket Risk Weights, Correlations, - * and Systemics. The References are: + * FXSettings20 demonstrates the Extraction and Display of ISDA SIMM 2.0 FX Bucket Risk Weights, + * Correlations, and Systemics. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -73,14 +73,14 @@ * @author Lakshmi Krishnamurthy */ -public class FXSettings +public class FXSettings20 { private static final void Systemics() { System.out.println ("\t||----------------------------------------------------------------||"); - System.out.println ("\t|| FX SYSTEMICS ||"); + System.out.println ("\t|| 2.0 FX SYSTEMICS ||"); System.out.println ("\t||----------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/InterestRateConcentrationThreshold.java b/src/main/java/org/drip/sample/simmsettings/InterestRateConcentrationThreshold20.java similarity index 94% rename from src/main/java/org/drip/sample/simm20settings/InterestRateConcentrationThreshold.java rename to src/main/java/org/drip/sample/simmsettings/InterestRateConcentrationThreshold20.java index 36bbad70ed0d..1cc342439709 100644 --- a/src/main/java/org/drip/sample/simm20settings/InterestRateConcentrationThreshold.java +++ b/src/main/java/org/drip/sample/simmsettings/InterestRateConcentrationThreshold20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.Set; @@ -54,8 +54,8 @@ */ /** - * InterestRateConcentrationThreshold demonstrates the Extraction and Display of ISDA SIMM 2.0 Interest Rate - * Concentration Thresholds. The References are: + * InterestRateConcentrationThreshold20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Interest + * Rate Concentration Thresholds. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, * https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156, eSSRN. @@ -76,7 +76,7 @@ * @author Lakshmi Krishnamurthy */ -public class InterestRateConcentrationThreshold +public class InterestRateConcentrationThreshold20 { private static final void DisplayBuckets() @@ -86,7 +86,7 @@ private static final void DisplayBuckets() System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); - System.out.println ("\t|| INTEREST RATE CONCENTRATION THRESHOLD ||"); + System.out.println ("\t|| 2.0 INTEREST RATE CONCENTRATION THRESHOLD ||"); System.out.println ("\t||-------------------------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simm20settings/InterestRateSettings.java b/src/main/java/org/drip/sample/simmsettings/InterestRateSettings20.java similarity index 95% rename from src/main/java/org/drip/sample/simm20settings/InterestRateSettings.java rename to src/main/java/org/drip/sample/simmsettings/InterestRateSettings20.java index c413fc3a2c9e..17cf411ca52b 100644 --- a/src/main/java/org/drip/sample/simm20settings/InterestRateSettings.java +++ b/src/main/java/org/drip/sample/simmsettings/InterestRateSettings20.java @@ -1,5 +1,5 @@ -package org.drip.sample.simm20settings; +package org.drip.sample.simmsettings; import java.util.List; import java.util.Map; @@ -57,7 +57,7 @@ */ /** - * InterestRateSettings demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency + * InterestRateSettings20 demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency * Interest Rate Tenor Risk Weights, Systemics, and Correlations. The References are: * * - Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial Margin, @@ -79,7 +79,7 @@ * @author Lakshmi Krishnamurthy */ -public class InterestRateSettings +public class InterestRateSettings20 { private static final void RegularVolatility() @@ -87,7 +87,7 @@ private static final void RegularVolatility() { System.out.println ("\t||-----------------------------------------------------------------------------------||"); - System.out.println ("\t|| REGULAR VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); + System.out.println ("\t|| 2.0 REGULAR VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); System.out.println ("\t||-----------------------------------------------------------------------------------||"); @@ -124,7 +124,7 @@ private static final void LowVolatility() { System.out.println ("\t||-----------------------------------------------------------------------------------||"); - System.out.println ("\t|| LOW VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); + System.out.println ("\t|| 2.0 LOW VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); System.out.println ("\t||-----------------------------------------------------------------------------------||"); @@ -161,7 +161,7 @@ private static final void HighVolatility() { System.out.println ("\t||-----------------------------------------------------------------------------------||"); - System.out.println ("\t|| HIGH VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); + System.out.println ("\t|| 2.0 HIGH VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); System.out.println ("\t||-----------------------------------------------------------------------------------||"); diff --git a/src/main/java/org/drip/sample/simmsettings/package-info.java b/src/main/java/org/drip/sample/simmsettings/package-info.java new file mode 100644 index 000000000000..56dd58d21791 --- /dev/null +++ b/src/main/java/org/drip/sample/simmsettings/package-info.java @@ -0,0 +1,8 @@ + +/** + * ISDA SIMM Calibration Parameter Settings + * + * @author Lakshmi Krishnamurthy + */ + +package org.drip.sample.simmsettings; diff --git a/src/main/java/org/drip/simm20/parameters/BucketCurvatureSettingsIR.java b/src/main/java/org/drip/simm20/parameters/BucketCurvatureSettingsIR.java index 8e189105c4a7..18026499dfae 100644 --- a/src/main/java/org/drip/simm20/parameters/BucketCurvatureSettingsIR.java +++ b/src/main/java/org/drip/simm20/parameters/BucketCurvatureSettingsIR.java @@ -280,41 +280,6 @@ public java.util.Map tenorScalingFactorMap() return _tenorScalingFactorMap; } - @Override public java.util.Map oisTenorVegaRiskWeight() - { - return super.oisTenorRiskWeight(); - } - - @Override public java.util.Map libor1MTenorVegaRiskWeight() - { - return super.libor1MTenorRiskWeight(); - } - - @Override public java.util.Map libor3MTenorVegaRiskWeight() - { - return super.libor3MTenorRiskWeight(); - } - - @Override public java.util.Map libor6MTenorVegaRiskWeight() - { - return super.libor6MTenorRiskWeight(); - } - - @Override public java.util.Map libor12MTenorVegaRiskWeight() - { - return super.libor12MTenorRiskWeight(); - } - - @Override public java.util.Map primeTenorVegaRiskWeight() - { - return super.primeTenorRiskWeight(); - } - - @Override public java.util.Map municipalTenorVegaRiskWeight() - { - return super.municipalTenorRiskWeight(); - } - @Override public java.util.Map oisTenorRiskWeight() { java.util.Map oisTenorVegaRiskWeight =