diff --git a/ExposureLibrary.txt b/ExposureLibrary.html similarity index 100% rename from ExposureLibrary.txt rename to ExposureLibrary.html diff --git a/ReleaseNotes/06_19_2018.txt b/ReleaseNotes/06_19_2018.txt new file mode 100644 index 000000000000..63cd70fc808a --- /dev/null +++ b/ReleaseNotes/06_19_2018.txt @@ -0,0 +1,44 @@ + +Features: + + - Interest Rate Vega Risk Weight (1) + - IR Weight Specification Init #1 (2, 3) + - IR Weight Specification Init #2 (4, 5) + - IR Weight Specification Init #3 (6, 7) + - IR Weight Specification Init #4 (8, 9) + - IR Weight Specification Init #5 (10, 11) + - IR Weight Specification Init #6 (12, 13) + - IR Weight Specification Init #7 (14, 15) + - Interest Rate Tenor Correlation Shell (16) + - Interest Rate Tenor Correlation Matrix (17) + - Interest Rate Tenor Correlation List (18) + - Interest Rate Tenor Correlation Constructor (19, 20, 21) + - Interest Rate Tenor Index Map (22, 23) + - Interest Rate Tenor Correlation Entries (24, 25, 26) + - Sub-Tenor IR Correlation #1 (27, 28) + - Sub-Tenor IR Correlation #2 (29, 30) + - Sub-Tenor IR Correlation #3 (31, 32) + - Interest Rate Tenor Correlation Specification (33, 34) + - Interest Rate Tenor Correlation #1 (35, 36) + - Interest Rate Tenor Correlation #2 (37, 38) + - Interest Rate Tenor Correlation #3 (39, 40) + - Single Currency Curve Tenor Correlation (41, 42) + - Single Currency Inflation Tenor Correlation (43, 44) + - Basis Swap Spread Tenor Correlation (45) + - Single Cross Curve Currency Correlation (46, 47) + - Cross Currency Curve Inflation Correlation (48) + - Service Env SIMM 2.0 Specification (50) + + +Bug Fixes/Clean-up: + + - SIMM 2.0 Margin Requirements Calculations (49) + + +Samples: + + - Interest Rate Risk Weights Shell (51, 52) + - Interest Rate Risk Weights Regular (53, 54) + - USD IR Risk Weights #1 (55, 56) + - USD IR Risk Weights #2 (57, 58) + - USD IR Risk Weights #3 (59, 60) diff --git a/src/main/java/org/drip/sample/simm20/InterestRateRiskWeights.java b/src/main/java/org/drip/sample/simm20/InterestRateRiskWeights.java new file mode 100644 index 000000000000..82e0aa88e65d --- /dev/null +++ b/src/main/java/org/drip/sample/simm20/InterestRateRiskWeights.java @@ -0,0 +1,127 @@ + +package org.drip.sample.simm20; + +import java.util.Map; + +import org.drip.quant.common.FormatUtil; +import org.drip.service.env.EnvManager; +import org.drip.simm20.risk.InterestRateWeight; +import org.drip.simm20.risk.InterestRateWeightSpecification; + +/* + * -*- 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. + */ + +/** + * InterestRateRiskWeights demonstrates the Extraction and Display of ISDA SIMM 2.0 Single/Cross Currency + * Interest Rate Tenor Risk Weights 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. + * + * - 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 InterestRateRiskWeights +{ + + private static final void RegularVolatility() + throws Exception + { + System.out.println ("\t||-----------------------------------------------------------------------------------||"); + + System.out.println ("\t|| REGULAR VOLATILITY CURRENCY SET and RISK WEIGHTS ||"); + + System.out.println ("\t||-----------------------------------------------------------------------------------||"); + + System.out.println ( + "\t|| Currency Set => " + + InterestRateWeightSpecification.RegularVolatilityCurrencySet() + " ||" + ); + + System.out.println ("\t||-----------------------------------------------------------------------------------||"); + + System.out.println + ("\t||------------------------------------------------------------------------------------------------------------------------------------------------------||"); + + InterestRateWeight usdRiskWeight = InterestRateWeightSpecification.RiskWeight ("USD"); + + String tenorWeightSequence = "\t|| "; + + for (Map.Entry tenorWeightEntry : usdRiskWeight.tenorWeightMap().entrySet()) + { + tenorWeightSequence = tenorWeightSequence + " " + tenorWeightEntry.getKey() + " => " + + FormatUtil.FormatDouble (tenorWeightEntry.getValue(), 1, 0, 1.) + " |"; + } + + System.out.println (tenorWeightSequence + "|"); + + System.out.println + ("\t||------------------------------------------------------------------------------------------------------------------------------------------------------||"); + } + + public final static void main ( + final String[] args) + throws Exception + { + EnvManager.InitEnv (""); + + RegularVolatility(); + + EnvManager.TerminateEnv(); + } +} diff --git a/src/main/java/org/drip/sample/simm20/package-info.java b/src/main/java/org/drip/sample/simm20/package-info.java new file mode 100644 index 000000000000..7eb1d7121385 --- /dev/null +++ b/src/main/java/org/drip/sample/simm20/package-info.java @@ -0,0 +1,8 @@ + +/** + * ISDA SIMM 2.0 Margin Requirement Calculations + * + * @author Lakshmi Krishnamurthy + */ + +package org.drip.sample.simm20; diff --git a/src/main/java/org/drip/service/env/EnvManager.java b/src/main/java/org/drip/service/env/EnvManager.java index 90b15978d8b2..93b2b069a238 100644 --- a/src/main/java/org/drip/service/env/EnvManager.java +++ b/src/main/java/org/drip/service/env/EnvManager.java @@ -213,6 +213,13 @@ public static final java.sql.Statement InitEnv ( return null; } + if (!org.drip.simm20.risk.InterestRateWeightSpecification.Init()) { + System.out.println + ("EnvManager::InitEnv => Cannot Initialize SIMM 2.0 Interest Rate Weights Specification!"); + + return null; + } + if (s_bInvocationCapture) { if (!org.drip.service.env.InvocationManager.Setup()) diff --git a/src/main/java/org/drip/simm20/risk/InterestRateTenorCorrelation.java b/src/main/java/org/drip/simm20/risk/InterestRateTenorCorrelation.java new file mode 100644 index 000000000000..40b34094096b --- /dev/null +++ b/src/main/java/org/drip/simm20/risk/InterestRateTenorCorrelation.java @@ -0,0 +1,228 @@ + +package org.drip.simm20.risk; + +/* + * -*- 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. + */ + +/** + * InterestRateTenorCorrelation holds the ISDA SIMM 2.0 Tenor Correlations with a Single Currency/Curve. 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 InterestRateTenorCorrelation +{ + private double[][] _matrix = null; + private java.util.List _tenorList = null; + + private java.util.Map _tenorIndexMap = new + java.util.HashMap(); + + /** + * InterestRateTenorCorrelation Constructor + * + * @param tenorList The List of Tenors + * @param matrix The Correlation Matrix + * + * @throws java.lang.Exception Thrown if the Inputs are Invalid + */ + + public InterestRateTenorCorrelation ( + final java.util.List tenorList, + final double[][] matrix) + throws java.lang.Exception + { + if (null == (_tenorList = tenorList) || + null == (_matrix = matrix)) + { + throw new java.lang.Exception ("InterestRateTenorCorrelation Constructor => Invalid Inputs"); + } + + int tenorCount = _tenorList.size(); + + if (0 == tenorCount || tenorCount != _matrix.length) + { + throw new java.lang.Exception ("InterestRateTenorCorrelation Constructor => Invalid Inputs"); + } + + for (int tenorIndex = 0; tenorIndex < tenorCount; ++tenorIndex) + { + _tenorIndexMap.put ( + _tenorList.get (tenorIndex), + tenorIndex + ); + + if (null == _matrix[tenorIndex] || tenorCount != _matrix[tenorIndex].length || + !org.drip.quant.common.NumberUtil.IsValid (_matrix[tenorIndex])) + { + throw new java.lang.Exception ("InterestRateTenorCorrelation Constructor => Invalid Inputs"); + } + } + } + + /** + * Retrieve the Cross-Tenor Correlation Matrix + * + * @return The Cross-Tenor Correlation Matrix + */ + + public double[][] matrix() + { + return _matrix; + } + + /** + * Retrieve the Tenor List + * + * @return The Tenor List + */ + + public java.util.List tenorList() + { + return _tenorList; + } + + /** + * Retrieve the Correlation Entry for the Pait of Tenors + * + * @param tenor1 Tenor #1 + * @param tenor2 Tenor #2 + * + * @return The Correlation Entry + * + * @throws java.lang.Exception Thrown if the Inputs are Invalid + */ + + public double entry ( + final java.lang.String tenor1, + final java.lang.String tenor2) + throws java.lang.Exception + { + if (null == tenor1 || !_tenorList.contains (tenor1) || + null == tenor2 || !_tenorList.contains (tenor2)) + { + throw new java.lang.Exception ("InterestRateTenorCorrelation::entry => Invalid Inputs"); + } + + return _matrix[_tenorIndexMap.get (tenor1)][_tenorIndexMap.get (tenor2)]; + } + + /** + * Generate the InterestRateTenorCorrelation Instance that corresponds to the Tenor sub-space + * + * @param subTenorList The sub-Tenor List + * + * @return The InterestRateTenorCorrelation Instance + */ + + public InterestRateTenorCorrelation subTenor ( + final java.util.List subTenorList) + { + if (null == subTenorList) + { + return null; + } + + int subTenorSize = subTenorList.size(); + + if (0 == subTenorSize) + { + return null; + } + + double[][] subTenorMatrix = new double[subTenorSize][subTenorSize]; + + for (int subTenorOuterIndex = 0; subTenorOuterIndex < subTenorSize; ++subTenorOuterIndex) + { + for (int subTenorInnerIndex = 0; subTenorInnerIndex < subTenorSize; ++subTenorInnerIndex) + { + try + { + subTenorMatrix[subTenorOuterIndex][subTenorInnerIndex] = entry ( + subTenorList.get (subTenorOuterIndex), + subTenorList.get (subTenorInnerIndex) + ); + } + catch (java.lang.Exception e) + { + e.printStackTrace(); + + return null; + } + } + } + + try + { + return new InterestRateTenorCorrelation ( + subTenorList, + subTenorMatrix + ); + } + catch (java.lang.Exception e) + { + e.printStackTrace(); + } + + return null; + } +} diff --git a/src/main/java/org/drip/simm20/risk/InterestRateWeightSpecification.java b/src/main/java/org/drip/simm20/risk/InterestRateWeightSpecification.java index 82cd53d095a0..d2923ee6cb55 100644 --- a/src/main/java/org/drip/simm20/risk/InterestRateWeightSpecification.java +++ b/src/main/java/org/drip/simm20/risk/InterestRateWeightSpecification.java @@ -47,8 +47,8 @@ */ /** - * InterestRateWeight holds the ISDA SIMM 2.0 Tenor Vertex Risk Weights for Currencies across all - * Volatility Types. The References are: + * InterestRateWeightSpecification holds the ISDA SIMM 2.0 Tenor Vertex Risk Weights/Correlations for Single + * Curves, Cross Currencies, and Inflation. 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. @@ -91,20 +91,122 @@ public class InterestRateWeightSpecification public static final java.lang.String VOLATILITY_TYPE_HIGH = "HIGH"; /** - * Same Currency Inflation Rate Risk Weight + * Same Currency Curve Inflation Rate Risk Weight */ - public static final double SINGLE_CURRENCY_INFLATION_RISK_WEIGHT = 46.; + public static final double SINGLE_CURRENCY_CURVE_INFLATION_RISK_WEIGHT = 46.; /** - * Same Currency Cross-Currency Basis Swap Spread + * Single Currency Single Curve Basis Swap Spread */ - public static final double SINGLE_CURRENCY_XCCY_BASIS_SWAP_SPREAD_RISK_WEIGHT = 20.; + public static final double SINGLE_CURRENCY_CURVE_BASIS_SWAP_SPREAD_RISK_WEIGHT = 20.; + + /** + * Interest Rate Vega Risk Weight + */ + + public static final double VEGA_RISK_WEIGHT = 0.21; + + /** + * Single Currency Cross-Curve Correlation + */ + + public static final double SINGLE_CURRENCY_CROSS_CURVE_CORRELATION = 0.98; + + /** + * Single Currency Curve Inflation Correlation + */ + + public static final double SINGLE_CURRENCY_CURVE_INFLATION_CORRELATION = 0.29; + + /** + * Single Currency Curve Inflation Volatility Correlation + */ + + public static final double SINGLE_CURRENCY_CURVE_INFLATION_VOLATILITY_CORRELATION = 0.29; + + /** + * Single Currency Curve Basis Swap Spread Correlation + */ + + public static final double SINGLE_CURRENCY_CURVE_BASIS_SWAP_SPREAD_CORRELATION = 0.20; + + /** + * Single Currency Basis Swap Spread Inflation Correlation + */ + + public static final double SINGLE_CURRENCY_BASIS_SWAP_SPREAD_INFLATION_CORRELATION = 0.20; + + /** + * Cross Currency Curve Correlation + */ + + public static final double CROSS_CURRENCY_CORRELATION = 0.23; + + private static org.drip.simm20.risk.InterestRateTenorCorrelation s_Correlation = null; private static final java.util.Map - s_InterestRateRiskWeight = new java.util.HashMap(); + s_RiskWeight = new java.util.HashMap(); + + private static final boolean SetupTenorCorrelation() + { + java.util.List tenorList = new java.util.ArrayList(); + + tenorList.add ("2W"); + + tenorList.add ("1M"); + + tenorList.add ("3M"); + + tenorList.add ("6M"); + + tenorList.add ("1Y"); + + tenorList.add ("2Y"); + + tenorList.add ("3Y"); + + tenorList.add ("5Y"); + + tenorList.add ("10Y"); + + tenorList.add ("15Y"); + + tenorList.add ("20Y"); + + tenorList.add ("30Y"); + + try + { + s_Correlation = new org.drip.simm20.risk.InterestRateTenorCorrelation ( + tenorList, + new double[][] + { + {1.00, 0.99, 0.79, 0.67, 0.53, 0.42, 0.37, 0.30, 0.22, 0.18, 0.16, 0.12}, + {0.99, 1.00, 0.79, 0.67, 0.53, 0.42, 0.37, 0.30, 0.22, 0.18, 0.16, 0.12}, + {0.79, 0.79, 1.00, 0.85, 0.69, 0.57, 0.50, 0.42, 0.32, 0.25, 0.23, 0.20}, + {0.67, 0.67, 0.85, 1.00, 0.86, 0.76, 0.69, 0.59, 0.47, 0.40, 0.37, 0.32}, + {0.53, 0.53, 0.69, 0.86, 1.00, 0.93, 0.87, 0.77, 0.63, 0.57, 0.54, 0.50}, + {0.42, 0.42, 0.57, 0.76, 0.93, 1.00, 0.98, 0.90, 0.77, 0.70, 0.67, 0.63}, + {0.37, 0.37, 0.50, 0.69, 0.87, 0.98, 1.00, 0.96, 0.84, 0.78, 0.75, 0.71}, + {0.30, 0.30, 0.42, 0.59, 0.77, 0.90, 0.96, 1.00, 0.93, 0.89, 0.86, 0.82}, + {0.22, 0.22, 0.32, 0.47, 0.63, 0.77, 0.84, 0.93, 1.00, 0.98, 0.96, 0.94}, + {0.18, 0.18, 0.25, 0.40, 0.57, 0.70, 0.78, 0.89, 0.98, 1.00, 0.99, 0.98}, + {0.16, 0.16, 0.23, 0.37, 0.54, 0.67, 0.75, 0.86, 0.96, 0.99, 1.00, 0.99}, + {0.12, 0.12, 0.20, 0.32, 0.50, 0.63, 0.71, 0.82, 0.94, 0.98, 0.99, 1.00} + } + ); + + return true; + } + catch (java.lang.Exception e) + { + e.printStackTrace(); + } + + return false; + } /** * Initialize the Interest Rate Weight Specification Container @@ -114,9 +216,215 @@ public class InterestRateWeightSpecification public static final boolean Init() { + org.drip.simm20.risk.InterestRateWeight lowVolatilityRiskWeight = null; + org.drip.simm20.risk.InterestRateWeight highVolatilityRiskWeight = null; + org.drip.simm20.risk.InterestRateWeight regularVolatilityRiskWeight = null; + + java.util.Map tenorWeightMapLowVolatility = new + java.util.HashMap(); + + java.util.Map tenorWeightMapHighVolatility = new + java.util.HashMap(); + + java.util.Map tenorWeightMapRegularVolatility = new + java.util.HashMap(); + + tenorWeightMapRegularVolatility.put ( + "2W", + 113. + ); + + tenorWeightMapRegularVolatility.put ( + "1M", + 113. + ); + + tenorWeightMapRegularVolatility.put ( + "3M", + 98. + ); + + tenorWeightMapRegularVolatility.put ( + "6M", + 69. + ); + + tenorWeightMapRegularVolatility.put ( + "1Y", + 56. + ); + + tenorWeightMapRegularVolatility.put ( + "2Y", + 52. + ); + + tenorWeightMapRegularVolatility.put ( + "3Y", + 51. + ); + + tenorWeightMapRegularVolatility.put ( + "5Y", + 51. + ); + + tenorWeightMapRegularVolatility.put ( + "10Y", + 51. + ); + + tenorWeightMapRegularVolatility.put ( + "15Y", + 53. + ); + + tenorWeightMapRegularVolatility.put ( + "20Y", + 56. + ); + + tenorWeightMapRegularVolatility.put ( + "30Y", + 64. + ); + + tenorWeightMapHighVolatility.put ( + "2W", + 21. + ); + + tenorWeightMapLowVolatility.put ( + "1M", + 21. + ); + + tenorWeightMapLowVolatility.put ( + "3M", + 10. + ); + + tenorWeightMapLowVolatility.put ( + "6M", + 11. + ); + + tenorWeightMapLowVolatility.put ( + "1Y", + 15. + ); + + tenorWeightMapLowVolatility.put ( + "2Y", + 20. + ); + + tenorWeightMapLowVolatility.put ( + "3Y", + 22. + ); + + tenorWeightMapLowVolatility.put ( + "5Y", + 21. + ); + + tenorWeightMapLowVolatility.put ( + "10Y", + 19. + ); + + tenorWeightMapLowVolatility.put ( + "15Y", + 20. + ); + + tenorWeightMapLowVolatility.put ( + "20Y", + 23. + ); + + tenorWeightMapLowVolatility.put ( + "30Y", + 27. + ); + + tenorWeightMapHighVolatility.put ( + "2W", + 93. + ); + + tenorWeightMapHighVolatility.put ( + "1M", + 93. + ); + + tenorWeightMapHighVolatility.put ( + "3M", + 90. + ); + + tenorWeightMapHighVolatility.put ( + "6M", + 94. + ); + + tenorWeightMapHighVolatility.put ( + "1Y", + 97. + ); + + tenorWeightMapHighVolatility.put ( + "2Y", + 103. + ); + + tenorWeightMapHighVolatility.put ( + "3Y", + 101. + ); + + tenorWeightMapHighVolatility.put ( + "5Y", + 103. + ); + + tenorWeightMapHighVolatility.put ( + "10Y", + 102. + ); + + tenorWeightMapHighVolatility.put ( + "15Y", + 101. + ); + + tenorWeightMapHighVolatility.put ( + "20Y", + 102. + ); + + tenorWeightMapHighVolatility.put ( + "30Y", + 101. + ); + try { - + regularVolatilityRiskWeight = new org.drip.simm20.risk.InterestRateWeight ( + VOLATILITY_TYPE_REGULAR, + tenorWeightMapRegularVolatility + ); + + lowVolatilityRiskWeight = new org.drip.simm20.risk.InterestRateWeight ( + VOLATILITY_TYPE_LOW, + tenorWeightMapLowVolatility + ); + + highVolatilityRiskWeight = new org.drip.simm20.risk.InterestRateWeight ( + VOLATILITY_TYPE_HIGH, + tenorWeightMapHighVolatility + ); } catch (java.lang.Exception e) { @@ -124,7 +432,88 @@ public static final boolean Init() return false; } - return true; + + s_RiskWeight.put ( + "AUD", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "CAD", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "CHF", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "DKK", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "EUR", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "GBP", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "HKD", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "JPY", + lowVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "KRW", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "NOK", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "OTHER", + highVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "USD", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "SEK", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "SGD", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "TWD", + regularVolatilityRiskWeight + ); + + s_RiskWeight.put ( + "USD", + regularVolatilityRiskWeight + ); + + return SetupTenorCorrelation(); } /** @@ -135,7 +524,7 @@ public static final boolean Init() public static final java.util.Set AvailableCurrencySet() { - return s_InterestRateRiskWeight.keySet(); + return s_RiskWeight.keySet(); } /** @@ -157,7 +546,7 @@ public static final java.util.Set VolatilityTypeCurrencySet ( java.util.Set currencySet = new java.util.HashSet(); for (java.util.Map.Entry - irRiskWeightMapEntry : s_InterestRateRiskWeight.entrySet()) + irRiskWeightMapEntry : s_RiskWeight.entrySet()) { if (irRiskWeightMapEntry.getValue().volatilityType().equalsIgnoreCase (volatilityType)) { @@ -209,10 +598,10 @@ public static final java.util.Set HighVolatilityCurrencySet() * @return TRUE - The IR Risk Weight is available for the specified Currency */ - public boolean ContainsRiskWeight ( + public static final boolean ContainsRiskWeight ( final java.lang.String currency) { - return null != currency && !currency.isEmpty() && s_InterestRateRiskWeight.containsKey (currency); + return null != currency && !currency.isEmpty() && s_RiskWeight.containsKey (currency); } /** @@ -223,10 +612,22 @@ public boolean ContainsRiskWeight ( * @return TRUE - The IR Risk Weight for the specified Currency */ - public org.drip.simm20.risk.InterestRateWeight RiskWeight ( + public static final org.drip.simm20.risk.InterestRateWeight RiskWeight ( final java.lang.String currency) { - return ContainsRiskWeight (currency) ? s_InterestRateRiskWeight.get (currency) : null; + return ContainsRiskWeight (currency) ? s_RiskWeight.get (currency) : + s_RiskWeight.get ("OTHER"); + } + + /** + * Retrieve the Interest Rate Tenor Correlation Instance + * + * @return The Interest Rate Tenor Correlation Instance + */ + + public static final org.drip.simm20.risk.InterestRateTenorCorrelation correlation() + { + return s_Correlation; } /** @@ -238,6 +639,6 @@ public org.drip.simm20.risk.InterestRateWeight RiskWeight ( public static final java.util.Map InterestRateRiskWeight() { - return s_InterestRateRiskWeight; + return s_RiskWeight; } } diff --git a/src/test/java/org/drip/coverage/xva/Burgard2011.java b/src/test/java/org/drip/coverage/xva/Burgard2011.java deleted file mode 100644 index 48d3be53d62c..000000000000 --- a/src/test/java/org/drip/coverage/xva/Burgard2011.java +++ /dev/null @@ -1,87 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.burgard2011.CorrelatedNumeraireXVAAttribution; -import org.drip.sample.burgard2011.CorrelatedNumeraireXVAExplain; -import org.drip.sample.burgard2011.CorrelatedNumeraireXVAGreeks; -import org.drip.sample.burgard2011.CorrelatedNumeraireXVAReplicationPortfolio; -import org.drip.sample.burgard2011.XVAExplain; -import org.drip.sample.burgard2011.XVAGreeks; -import org.drip.sample.burgard2011.XVAMarketGeneration; -import org.drip.sample.burgard2011.XVAReplicationPortfolio; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * Burgard2011 holds the JUnit Code Coverage Tests for the Burgard-Kjaer (2011) XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class Burgard2011 -{ - @Test public void codeCoverageTest() throws Exception - { - CorrelatedNumeraireXVAAttribution.main (null); - - CorrelatedNumeraireXVAExplain.main (null); - - CorrelatedNumeraireXVAGreeks.main (null); - - CorrelatedNumeraireXVAReplicationPortfolio.main (null); - - XVAExplain.main (null); - - XVAGreeks.main (null); - - XVAMarketGeneration.main (null); - - XVAReplicationPortfolio.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/Burgard2012.java b/src/test/java/org/drip/coverage/xva/Burgard2012.java deleted file mode 100644 index a91706c99886..000000000000 --- a/src/test/java/org/drip/coverage/xva/Burgard2012.java +++ /dev/null @@ -1,81 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.burgard2012.CounterPartyHazardHigh; -import org.drip.sample.burgard2012.CounterPartyHazardLow; -import org.drip.sample.burgard2012.CounterPartyHazardMedium; -import org.drip.sample.burgard2012.EulerTrajectoryEvolutionScheme; -import org.drip.sample.burgard2012.FixFloatVABank; -import org.drip.sample.burgard2012.FixFloatVACounterParty; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * Burgard2012 holds the JUnit Code Coverage Tests for the Burgard-Kjaer (2012) XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class Burgard2012 -{ - @Test public void codeCoverageTest() throws Exception - { - CounterPartyHazardHigh.main (null); - - CounterPartyHazardLow.main (null); - - CounterPartyHazardMedium.main (null); - - EulerTrajectoryEvolutionScheme.main (null); - - FixFloatVABank.main (null); - - FixFloatVACounterParty.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/Netting.java b/src/test/java/org/drip/coverage/xva/Netting.java deleted file mode 100644 index 1cd1d3b4a3f3..000000000000 --- a/src/test/java/org/drip/coverage/xva/Netting.java +++ /dev/null @@ -1,78 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.netting.PortfolioGroupRun; -import org.drip.sample.netting.PortfolioGroupSimulation; -import org.drip.sample.netting.PortfolioPathAggregationCorrelated; -import org.drip.sample.netting.PortfolioPathAggregationDeterministic; -import org.drip.sample.netting.PortfolioPathAggregationUncorrelated; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * Netting holds the JUnit Code Coverage Tests for the Netting XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class Netting -{ - @Test public void codeCoverageTest() throws Exception - { - PortfolioGroupRun.main (null); - - PortfolioGroupSimulation.main (null); - - PortfolioPathAggregationCorrelated.main (null); - - PortfolioPathAggregationDeterministic.main (null); - - PortfolioPathAggregationUncorrelated.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/Piterbarg2010.java b/src/test/java/org/drip/coverage/xva/Piterbarg2010.java deleted file mode 100644 index 948e6a089170..000000000000 --- a/src/test/java/org/drip/coverage/xva/Piterbarg2010.java +++ /dev/null @@ -1,78 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.piterbarg2010.CSAFundingAbsoluteForward; -import org.drip.sample.piterbarg2010.CSAFundingRelativeForward; -import org.drip.sample.piterbarg2010.CSAImpliedMeasureDifference; -import org.drip.sample.piterbarg2010.ForwardContract; -import org.drip.sample.piterbarg2010.ZeroStrikeCallOption; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * Piterbarg2010 holds the JUnit Code Coverage Tests for the Piterbarg (2010) XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class Piterbarg2010 -{ - @Test public void codeCoverageTest() throws Exception - { - CSAFundingAbsoluteForward.main (null); - - CSAFundingRelativeForward.main (null); - - CSAImpliedMeasureDifference.main (null); - - ForwardContract.main (null); - - ZeroStrikeCallOption.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/Piterbarg2012.java b/src/test/java/org/drip/coverage/xva/Piterbarg2012.java deleted file mode 100644 index db6cec52b2b6..000000000000 --- a/src/test/java/org/drip/coverage/xva/Piterbarg2012.java +++ /dev/null @@ -1,81 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.piterbarg2012.DeterministicCollateralChoiceZeroCoupon; -import org.drip.sample.piterbarg2012.DomesticCollateralForeignForex; -import org.drip.sample.piterbarg2012.DomesticCollateralForeignForexAnalysis; -import org.drip.sample.piterbarg2012.ForeignCollateralDomesticForex; -import org.drip.sample.piterbarg2012.ForeignCollateralDomesticForexAnalysis; -import org.drip.sample.piterbarg2012.ForeignCollateralizedZeroCoupon; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * Piterbarg2012 holds the JUnit Code Coverage Tests for the Piterbarg (2012) XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class Piterbarg2012 -{ - @Test public void codeCoverageTest() throws Exception - { - DeterministicCollateralChoiceZeroCoupon.main (null); - - DomesticCollateralForeignForex.main (null); - - DomesticCollateralForeignForexAnalysis.main (null); - - ForeignCollateralDomesticForex.main (null); - - ForeignCollateralDomesticForexAnalysis.main (null); - - ForeignCollateralizedZeroCoupon.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/XVA.java b/src/test/java/org/drip/coverage/xva/XVA.java deleted file mode 100644 index 72bb99dc97bc..000000000000 --- a/src/test/java/org/drip/coverage/xva/XVA.java +++ /dev/null @@ -1,84 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.xva.CollateralizedCollateralGroup; -import org.drip.sample.xva.CollateralizedCollateralGroupCorrelated; -import org.drip.sample.xva.PortfolioCollateralEstimate; -import org.drip.sample.xva.UncollateralizedCollateralGroup; -import org.drip.sample.xva.UncollateralizedCollateralGroupCorrelated; -import org.drip.sample.xva.ZeroThresholdCollateralGroup; -import org.drip.sample.xva.ZeroThresholdCollateralGroupCorrelated; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * XVA holds the JUnit Code Coverage Tests for the Core XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class XVA -{ - @Test public void codeCoverageTest() throws Exception - { - CollateralizedCollateralGroup.main (null); - - CollateralizedCollateralGroupCorrelated.main (null); - - PortfolioCollateralEstimate.main (null); - - UncollateralizedCollateralGroup.main (null); - - UncollateralizedCollateralGroupCorrelated.main (null); - - ZeroThresholdCollateralGroup.main (null); - - ZeroThresholdCollateralGroupCorrelated.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/XVAStrategy.java b/src/test/java/org/drip/coverage/xva/XVAStrategy.java deleted file mode 100644 index 7d7cf46e2042..000000000000 --- a/src/test/java/org/drip/coverage/xva/XVAStrategy.java +++ /dev/null @@ -1,81 +0,0 @@ - -package org.drip.coverage.xva; - -import org.drip.sample.xvastrategy.FundingGroupBilateralCSA; -import org.drip.sample.xvastrategy.FundingGroupHedgeError; -import org.drip.sample.xvastrategy.FundingGroupPerfectReplication; -import org.drip.sample.xvastrategy.FundingGroupSemiReplication; -import org.drip.sample.xvastrategy.FundingGroupSetOff; -import org.drip.sample.xvastrategy.FundingGroupUnilateralCSA; - -import org.junit.Test; - -/* - * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ - -/*! - * Copyright (C) 2018 Lakshmi Krishnamurthy - * Copyright (C) 2017 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. - */ - -/** - * XVAStrategy holds the JUnit Code Coverage Tests for the Strategy Metrics for the XVA Module. - * - * @author Lakshmi Krishnamurthy - */ - -public class XVAStrategy -{ - @Test public void codeCoverageTest() throws Exception - { - FundingGroupBilateralCSA.main (null); - - FundingGroupHedgeError.main (null); - - FundingGroupPerfectReplication.main (null); - - FundingGroupSemiReplication.main (null); - - FundingGroupSetOff.main (null); - - FundingGroupUnilateralCSA.main (null); - } -} diff --git a/src/test/java/org/drip/coverage/xva/package-info.java b/src/test/java/org/drip/coverage/xva/package-info.java deleted file mode 100644 index 069113fcb1e9..000000000000 --- a/src/test/java/org/drip/coverage/xva/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ - -/** - * XVA Module Code Coverage Estimation Suite - * - * @author Lakshmi Krishnamurthy - */ - -package org.drip.coverage.xva;