Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- 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)
  • Loading branch information
lakshmiDRIP committed Jul 3, 2018
1 parent 245913f commit 0bb4cc1
Show file tree
Hide file tree
Showing 15 changed files with 832 additions and 595 deletions.
File renamed without changes.
44 changes: 44 additions & 0 deletions ReleaseNotes/06_19_2018.txt
Original file line number Diff line number Diff line change
@@ -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)
127 changes: 127 additions & 0 deletions src/main/java/org/drip/sample/simm20/InterestRateRiskWeights.java
Original file line number Diff line number Diff line change
@@ -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<String, Double> 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();
}
}
8 changes: 8 additions & 0 deletions src/main/java/org/drip/sample/simm20/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/**
* ISDA SIMM 2.0 Margin Requirement Calculations
*
* @author Lakshmi Krishnamurthy
*/

package org.drip.sample.simm20;
7 changes: 7 additions & 0 deletions src/main/java/org/drip/service/env/EnvManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Loading

0 comments on commit 0bb4cc1

Please sign in to comment.