Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
Bug Fixes/Re-organization:

	- SIMM Estimator Product Class Settings - Label Correlation (1)
	- SIMM Estimator Product Class Settings - FX Risk Sensitivity (2, 3)
	- SIMM Estimator Product Class Settings - IR Risk Sensitivity (4, 5)
	- SIMM Estimator Product Class Settings - Equity Risk Sensitivity (6, 7)
	- SIMM Estimator Product Class Settings - Commodity Risk Sensitivity (8, 9)
	- SIMM Estimator Product Class Settings - Credit Qualifying Risk Sensitivity (10, 11)
	- SIMM Estimator Product Class Settings - Non-credit Qualifying Risk Sensitivity (12, 13)
	- SIMM Estimator Product Class Settings - ISDA 2.0 (14)
	- SIMM Estimator Product Class Settings - ISDA 2.1 (15)
	- SIMM Estimator Product Class Settings - ISDA 2.4 (16)
	- SIMM Estimator Product Class Settings - Constructor (17, 18, 19)
	- SIMM Foundation Curvature Estimator (20, 21)
	- SIMM Foundation Curvature Estimator - Compute the SBA Margin from the Sensitivities (22)
	- SIMM Foundation Curvature Estimator - Indicate if the Correlator is Quadratic (23)
	- SIMM Foundation Curvature Estimator - Generate the Bucket Pair  Variance Modulator (24)
	- SIMM Foundation Curvature Estimator FRTB (25, 26)
	- SIMM Foundation Curvature Estimator FRTB - Construct the Standard Instance (27)
	- SIMM Foundation Curvature Estimator FRTB - Empty Constructor (28)
	- SIMM Foundation Curvature Estimator FRTB - Margin (29)
	- SIMM Foundation Curvature Estimator FRTB - Is Correlator Quadratric (30)
	- SIMM Foundation Curvature Estimator FRTB - Variance Modulator (31)
	- SIMM Foundation Curvature Estimator ISDA Delta (32, 33)
	- SIMM Foundation Curvature Estimator ISDA Delta - Construct the Standard Instance (34)
	- SIMM Foundation Curvature Estimator ISDA Delta - Empty Constructor (35)
	- SIMM Foundation Curvature Estimator ISDA Delta - Margin (36, 37)
	- SIMM Foundation Curvature Estimator ISDA Delta - Is Correlator Quadratric (38)
	- SIMM Foundation Curvature Estimator ISDA Delta - Variance Modulator (39)
	- SIMM Foundation Curvature Estimator Response Function #1 (40, 41)
	- SIMM Foundation Curvature Response (42, 43)
	- SIMM Foundation Curvature Response - Lambda (44)
	- SIMM Foundation Curvature Estimator Response Function #2 (45, 46)
	- SIMM Foundation Curvature Estimator Response Function - Constructor (47)
	- SIMM Foundation Curvature Estimator Response Function - Margin (48)
	- SIMM Foundation Curvature Estimator Response Function - Correlator is Quadratic (49)
	- SIMM Foundation Curvature Estimator Response Function - Variance Modulator (50)
	- SIMM Foundation Curvature Response Cornish Fischer (51, 52)
	- SIMM Foundation Curvature Response Cornish Fischer - ISDA SIMM VaR Cut-off (53)
	- SIMM Foundation Curvature Response Cornish Fischer - Retrieve the VaR Cut-off (54, 55)
	- SIMM Foundation Curvature Response Cornish Fischer - Retrieve the Lambda Plateau Peak (56, 57)
	- SIMM Foundation Curvature Response Cornish Fischer - Standard (58)
	- SIMM Foundation Curvature Response Cornish Fischer - Constructor (59)
	- SIMM Foundation Curvature Response Cornish Fischer - Lambda (60)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Jun 9, 2024
1 parent 4999659 commit be6238a
Show file tree
Hide file tree
Showing 8 changed files with 297 additions and 211 deletions.
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
121 changes: 48 additions & 73 deletions src/main/java/org/drip/simm/estimator/ProductClassSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,17 @@
* It provides the following Functionality:
*
* <ul>
* <li><i>ProductClassSensitivity</i> Constructor</li>
* <li>Construct an ISDA SIMM 2.0 Version of <i>ProductClassSettings</i></li>
* <li>Construct an ISDA SIMM 2.1 Version of <i>ProductClassSettings</i></li>
* <li>Construct an ISDA SIMM 2.4 Version of <i>ProductClassSettings</i></li>
* <li><i>ProductClassSettings</i> Constructor</li>
* <li>Retrieve the Equity Risk Class Sensitivity Settings</li>
* <li>Retrieve the Commodity Risk Class Sensitivity Settings</li>
* <li>Retrieve the FX Risk Class Sensitivity Settings</li>
* <li>Retrieve the IR Risk Class Sensitivity Settings</li>
* <li>Retrieve the Credit Qualifying Risk Class Sensitivity Settings</li>
* <li>Retrieve the Credit Non-Qualifying Risk Class Sensitivity Settings</li>
* <li>Retrieve the Cross Risk Class Label Correlation</li>
* </ul>
*
* <br>
Expand All @@ -148,96 +158,74 @@ public class ProductClassSettings
private RiskClassSensitivitySettingsCR _creditNonQualifyingRiskClassSensitivitySettings = null;

/**
* Construct an ISDA SIMM 2.0 Version of ProductClassSettings
* Construct an ISDA SIMM 2.0 Version of <i>ProductClassSettings</i>
*
* @param currencyList Currency List
* @param vegaDurationDays The Volatility Duration in Days
*
* @return ISDA SIMM 2.0 Version of ProductClassSettings
* @return ISDA SIMM 2.0 Version of <i>ProductClassSettings</i>
*/

public static final ProductClassSettings ISDA_20 (
final List<String> currencyList,
final int vegaDurationDays)
{
try
{
try {
return new ProductClassSettings (
RiskClassSensitivitySettings.ISDA_EQ_20 (
vegaDurationDays
),
RiskClassSensitivitySettings.ISDA_CT_20 (
vegaDurationDays
),
RiskClassSensitivitySettings.ISDA_FX_20 (
vegaDurationDays
),
RiskClassSensitivitySettingsIR.ISDA_20 (
currencyList
),
RiskClassSensitivitySettings.ISDA_EQ_20 (vegaDurationDays),
RiskClassSensitivitySettings.ISDA_CT_20 (vegaDurationDays),
RiskClassSensitivitySettings.ISDA_FX_20 (vegaDurationDays),
RiskClassSensitivitySettingsIR.ISDA_20 (currencyList),
RiskClassSensitivitySettingsCR.ISDA_CRQ_20(),
RiskClassSensitivitySettingsCR.ISDA_CRNQ_20(),
CrossRiskClassCorrelation20.Matrix()
);
}
catch (Exception e)
{
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

/**
* Construct an ISDA SIMM 2.1 Version of ProductClassSettings
* Construct an ISDA SIMM 2.1 Version of <i>ProductClassSettings</i>
*
* @param currencyList Currency List
* @param vegaDurationDays The Volatility Duration in Days
*
* @return ISDA SIMM 2.1 Version of ProductClassSettings
* @return ISDA SIMM 2.1 Version of <i>ProductClassSettings</i>
*/

public static final ProductClassSettings ISDA_21 (
final List<String> currencyList,
final int vegaDurationDays)
{
try
{
try {
return new ProductClassSettings (
RiskClassSensitivitySettings.ISDA_EQ_21 (
vegaDurationDays
),
RiskClassSensitivitySettings.ISDA_CT_21 (
vegaDurationDays
),
RiskClassSensitivitySettings.ISDA_FX_21 (
vegaDurationDays
),
RiskClassSensitivitySettingsIR.ISDA_21 (
currencyList
),
RiskClassSensitivitySettings.ISDA_EQ_21 (vegaDurationDays),
RiskClassSensitivitySettings.ISDA_CT_21 (vegaDurationDays),
RiskClassSensitivitySettings.ISDA_FX_21 (vegaDurationDays),
RiskClassSensitivitySettingsIR.ISDA_21 (currencyList),
RiskClassSensitivitySettingsCR.ISDA_CRQ_21(),
RiskClassSensitivitySettingsCR.ISDA_CRNQ_21(),
CrossRiskClassCorrelation21.Matrix()
);
}
catch (Exception e)
{
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

/**
* Construct an ISDA SIMM 2.4 Version of ProductClassSettings
* Construct an ISDA SIMM 2.4 Version of <i>ProductClassSettings</i>
*
* @param currencyList Currency List
* @param vegaDurationDays The Volatility Duration in Days
* @param givenCurrency Given Currency
* @param calculationCurrency Calculation Currency
*
* @return ISDA SIMM 2.4 Version of ProductClassSettings
* @return ISDA SIMM 2.4 Version of <i>ProductClassSettings</i>
*/

public static final ProductClassSettings ISDA_24 (
Expand All @@ -246,38 +234,29 @@ public static final ProductClassSettings ISDA_24 (
final String givenCurrency,
final String calculationCurrency)
{
try
{
try {
return new ProductClassSettings (
RiskClassSensitivitySettings.ISDA_EQ_24 (
vegaDurationDays
),
RiskClassSensitivitySettings.ISDA_CT_24 (
vegaDurationDays
),
RiskClassSensitivitySettings.ISDA_EQ_24 (vegaDurationDays),
RiskClassSensitivitySettings.ISDA_CT_24 (vegaDurationDays),
RiskClassSensitivitySettings.ISDA_FX_24 (
vegaDurationDays,
givenCurrency,
calculationCurrency
),
RiskClassSensitivitySettingsIR.ISDA_24 (
currencyList
),
RiskClassSensitivitySettingsIR.ISDA_24 (currencyList),
RiskClassSensitivitySettingsCR.ISDA_CRQ_24(),
RiskClassSensitivitySettingsCR.ISDA_CRNQ_24(),
CrossRiskClassCorrelation21.Matrix()
);
}
catch (Exception e)
{
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

/**
* ProductClassSettings Constructor
* <i>ProductClassSettings</i> Constructor
*
* @param equityRiskClassSensitivitySettings Equity Risk Class Sensitivity Settings
* @param commodityRiskClassSensitivitySettings Commodity Risk Class Sensitivity Settings
Expand All @@ -301,24 +280,20 @@ public ProductClassSettings (
final LabelCorrelation labelCorrelation)
throws Exception
{
_fxRiskClassSensitivitySettings = fxRiskClassSensitivitySettings;
_irRiskClassSensitivitySettings = irRiskClassSensitivitySettings;
_equityRiskClassSensitivitySettings = equityRiskClassSensitivitySettings;
_commodityRiskClassSensitivitySettings = commodityRiskClassSensitivitySettings;
_creditQualifyingRiskClassSensitivitySettings = creditQualifyingRiskClassSensitivitySettings;
_creditNonQualifyingRiskClassSensitivitySettings = creditNonQualifyingRiskClassSensitivitySettings;

if ((null == _equityRiskClassSensitivitySettings &&
null == _commodityRiskClassSensitivitySettings &&
null == _fxRiskClassSensitivitySettings &&
null == _irRiskClassSensitivitySettings &&
null == _creditQualifyingRiskClassSensitivitySettings &&
null == _creditNonQualifyingRiskClassSensitivitySettings) ||
null == (_labelCorrelation = labelCorrelation))
if (
(
null == (_equityRiskClassSensitivitySettings = equityRiskClassSensitivitySettings) &&
null == (_commodityRiskClassSensitivitySettings = commodityRiskClassSensitivitySettings) &&
null == (_fxRiskClassSensitivitySettings = fxRiskClassSensitivitySettings) &&
null == (_irRiskClassSensitivitySettings = irRiskClassSensitivitySettings) &&
null == (_creditQualifyingRiskClassSensitivitySettings =
creditQualifyingRiskClassSensitivitySettings) &&
null == (_creditNonQualifyingRiskClassSensitivitySettings =
creditNonQualifyingRiskClassSensitivitySettings
)
) || null == (_labelCorrelation = labelCorrelation))
{
throw new Exception (
"ProductClassSettings Constructor => Invalid Inputs"
);
throw new Exception ("ProductClassSettings Constructor => Invalid Inputs");
}
}

Expand Down
27 changes: 19 additions & 8 deletions src/main/java/org/drip/simm/foundation/CurvatureEstimator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -79,7 +82,7 @@

/**
* <i>CurvatureEstimator</i> exposes the Curvature Margin Estimation using the Curvature Sensitivities. The
* References are:
* References are:
*
* <br><br>
* <ul>
Expand All @@ -106,15 +109,23 @@
* https://www.isda.org/a/oFiDE/isda-simm-v2.pdf
* </li>
* </ul>
*
* <br><br>
*
* It provides the following Functionality:
*
* <ul>
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/MarginAnalyticsLibrary.md">Initial and Variation Margin Analytics</a></li>
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/simm/README.md">Initial Margin Analytics based on ISDA SIMM and its Variants</a></li>
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/simm/foundation/README.md">Foundation Utilities for ISDA SIMM</a></li>
* <li>Compute the SBA Margin from the Curvature Sensitivities</li>
* <li>Indicate if the Correlator is Quadratic</li>
* <li>Generate the Bucket Pair Curvature Variance Modulator</li>
* </ul>
* <br><br>
*
* <br>
* <table style="border:1px solid black;margin-left:auto;margin-right:auto;">
* <tr><td><b>Module </b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></td></tr>
* <tr><td><b>Library</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/MarginAnalyticsLibrary.md">Initial and Variation Margin Analytics</a></td></tr>
* <tr><td><b>Project</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/simm/README.md">Initial Margin Analytics based on ISDA SIMM and its Variants</a></td></tr>
* <tr><td><b>Package</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/simm/foundation/README.md">Foundation Utilities for ISDA SIMM</a></td></tr>
* </table>
* <br>
*
* @author Lakshmi Krishnamurthy
*/
Expand Down
Loading

0 comments on commit be6238a

Please sign in to comment.