Skip to content

Commit

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

	- Spaces Tensor R^d Combinatorial Vector - Iterator (1)
	- Spaces Tensor R^d Combinatorial Vector - Left Dimension Edge (2, 3)
	- Spaces Tensor R^d Combinatorial Vector - Right Dimension Edge (4, 5)
	- Spaces Tensor R^d Combinatorial Vector - Left Dimension (6, 7)
	- Spaces Tensor R^d Combinatorial Vector - Right Dimension (8, 9)
	- Spaces Tensor R^d Combinatorial Vector - Hyper Volume (10, 11)
	- Spaces Tensor R^1 Continuous Vector (12, 13)
	- Spaces Tensor R^1 Continuous Vector - Left Edge (14, 15)
	- Spaces Tensor R^1 Continuous Vector - Right Edge (16, 17)
	- Spaces Tensor R^1 Continuous Vector - Standard (18)
	- Spaces Tensor R^1 Continuous Vector - Constructor (19, 20)
	- Spaces Tensor R^1 Continuous Vector - Validate Instance (21)
	- Spaces Tensor R^1 Continuous Vector - Cardinality (22)
	- Spaces Tensor R^1 Continuous Vector - Match (23)
	- Spaces Tensor R^1 Continuous Vector - Subset (24)
	- Spaces Tensor R^1 Continuous Vector - Is Predictor Bounded (25)
	- Spaces Tensor R^1 Continuous Vector - Hyper-Volume (26)
	- SIMM Commodity CT Bucket (27, 28)
	- SIMM Commodity CT Bucket - Number (29, 30)
	- SIMM Commodity CT Bucket - Entity (31, 32)
	- SIMM Commodity CT Bucket - Delta Risk Weight (33, 34)
	- SIMM Commodity CT Bucket - Member Correlation (35, 36)
	- SIMM Commodity CT Bucket - Constructor (37, 38, 39)
	- SIMM Commodity CT Risk Threshold Container 2.0 #1 (40, 41)
	- SIMM Commodity CT Risk Threshold Container 2.0 - Delta Vega Map (42, 43)
	- SIMM Commodity CT Risk Threshold Container 2.0 #2 (44)
	- SIMM Commodity CT Risk Threshold Container 2.0 - Contains Bucket (45)
	- SIMM Commodity CT Risk Threshold Container 2.0 - Bucket Set (46)
	- SIMM Commodity CT Risk Threshold Container 2.0 - Init #1 (47, 48)
	- SIMM Commodity CT Risk Threshold Container 2.0 - Init #2 (49, 50, 51)
	- SIMM Commodity CT Risk Threshold Container 2.0 - Init #3 (52, 53)
	- SIMM Commodity CT Risk Threshold Container 2.1 #1 (54, 55)
	- SIMM Commodity CT Risk Threshold Container 2.1 - Delta Vega Map (56, 57)
	- SIMM Commodity CT Risk Threshold Container 2.1 #2 (58)
	- SIMM Commodity CT Risk Threshold Container 2.1 - Contains Bucket (59)
	- SIMM Commodity CT Risk Threshold Container 2.1 - Bucket Set (60)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Jun 3, 2024
1 parent a4550d5 commit b4aed3e
Show file tree
Hide file tree
Showing 7 changed files with 332 additions and 278 deletions.
46 changes: 46 additions & 0 deletions ReleaseNotes/11_22_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

Features:

Bug Fixes/Re-organization:

- Spaces Tensor R^d Combinatorial Vector - Iterator (1)
- Spaces Tensor R^d Combinatorial Vector - Left Dimension Edge (2, 3)
- Spaces Tensor R^d Combinatorial Vector - Right Dimension Edge (4, 5)
- Spaces Tensor R^d Combinatorial Vector - Left Dimension (6, 7)
- Spaces Tensor R^d Combinatorial Vector - Right Dimension (8, 9)
- Spaces Tensor R^d Combinatorial Vector - Hyper Volume (10, 11)
- Spaces Tensor R^1 Continuous Vector (12, 13)
- Spaces Tensor R^1 Continuous Vector - Left Edge (14, 15)
- Spaces Tensor R^1 Continuous Vector - Right Edge (16, 17)
- Spaces Tensor R^1 Continuous Vector - Standard (18)
- Spaces Tensor R^1 Continuous Vector - Constructor (19, 20)
- Spaces Tensor R^1 Continuous Vector - Validate Instance (21)
- Spaces Tensor R^1 Continuous Vector - Cardinality (22)
- Spaces Tensor R^1 Continuous Vector - Match (23)
- Spaces Tensor R^1 Continuous Vector - Subset (24)
- Spaces Tensor R^1 Continuous Vector - Is Predictor Bounded (25)
- Spaces Tensor R^1 Continuous Vector - Hyper-Volume (26)
- SIMM Commodity CT Bucket (27, 28)
- SIMM Commodity CT Bucket - Number (29, 30)
- SIMM Commodity CT Bucket - Entity (31, 32)
- SIMM Commodity CT Bucket - Delta Risk Weight (33, 34)
- SIMM Commodity CT Bucket - Member Correlation (35, 36)
- SIMM Commodity CT Bucket - Constructor (37, 38, 39)
- SIMM Commodity CT Risk Threshold Container 2.0 #1 (40, 41)
- SIMM Commodity CT Risk Threshold Container 2.0 - Delta Vega Map (42, 43)
- SIMM Commodity CT Risk Threshold Container 2.0 #2 (44)
- SIMM Commodity CT Risk Threshold Container 2.0 - Contains Bucket (45)
- SIMM Commodity CT Risk Threshold Container 2.0 - Bucket Set (46)
- SIMM Commodity CT Risk Threshold Container 2.0 - Init #1 (47, 48)
- SIMM Commodity CT Risk Threshold Container 2.0 - Init #2 (49, 50, 51)
- SIMM Commodity CT Risk Threshold Container 2.0 - Init #3 (52, 53)
- SIMM Commodity CT Risk Threshold Container 2.1 #1 (54, 55)
- SIMM Commodity CT Risk Threshold Container 2.1 - Delta Vega Map (56, 57)
- SIMM Commodity CT Risk Threshold Container 2.1 #2 (58)
- SIMM Commodity CT Risk Threshold Container 2.1 - Contains Bucket (59)
- SIMM Commodity CT Risk Threshold Container 2.1 - Bucket Set (60)


Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
44 changes: 25 additions & 19 deletions src/main/java/org/drip/simm/commodity/CTBucket.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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 @@ -81,7 +84,7 @@

/**
* <i>CTBucket</i> holds the ISDA SIMM Commodity, Risk Weight, and Member Correlation for each Commodity
* Bucket. The References are:
* Bucket. The References are:
*
* <br><br>
* <ul>
Expand All @@ -108,15 +111,25 @@
* 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/commodity/README.md">Commodity Risk Factor Calibration Settings</a></li>
* <li><i>CTBucket</i> Constructor</li>
* <li>Retrieve the SIMM Bucket Number</li>
* <li>Retrieve the SIMM Bucket Entity</li>
* <li>Retrieve the SIMM Delta Risk Weight</li>
* <li>Retrieve the SIMM Member Correlation</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/commodity/README.md">Commodity Risk Factor Calibration Settings</a></td></tr>
* </table>
* <br>
*
* @author Lakshmi Krishnamurthy
*/
Expand All @@ -129,7 +142,7 @@ public class CTBucket
private double _memberCorrelation = Double.NaN;

/**
* CTBucket Constructor
* <i>CTBucket</i> Constructor
*
* @param number Bucket Number
* @param entity Bucket Commodity Entity
Expand All @@ -147,17 +160,10 @@ public CTBucket (
throws java.lang.Exception
{
if (null == (_entity = entity) || _entity.isEmpty() ||
!NumberUtil.IsValid (
_deltaRiskWeight = deltaRiskWeight
) ||
!NumberUtil.IsValid (
_memberCorrelation = memberCorrelation
)
)
!NumberUtil.IsValid (_deltaRiskWeight = deltaRiskWeight) ||
!NumberUtil.IsValid (_memberCorrelation = memberCorrelation))
{
throw new Exception (
"CTBucket Constructor => Invalid Inputs"
);
throw new Exception ("CTBucket Constructor => Invalid Inputs");
}

_number = number;
Expand Down
214 changes: 58 additions & 156 deletions src/main/java/org/drip/simm/commodity/CTRiskThresholdContainer20.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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 @@ -85,7 +88,7 @@

/**
* <i>CTRiskThresholdContainer20</i> holds the ISDA SIMM 2.0 Commodity Risk Thresholds - the Commodity
* Buckets and the Delta/Vega Limits defined for the Concentration Thresholds. The References are:
* Buckets and the Delta/Vega Limits defined for the Concentration Thresholds. The References are:
*
* <br><br>
* <ul>
Expand All @@ -112,15 +115,25 @@
* 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/commodity/README.md">Commodity Risk Factor Calibration Settings</a></li>
* <li>Initialize the Commodity Risk Threshold Container</li>
* <li>Retrieve the Commodity Risk Threshold Bucket Set</li>
* <li>Indicate if the Bucket Number is available in the Commodity Risk Threshold Container</li>
* <li>Retrieve the Threshold indicated by the Bucket Number</li>
* <li>Retrieve the Delta Vega Threshold Map</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/commodity/README.md">Commodity Risk Factor Calibration Settings</a></td></tr>
* </table>
* <br>
*
* @author Lakshmi Krishnamurthy
*/
Expand All @@ -138,146 +151,41 @@ public class CTRiskThresholdContainer20

public static final boolean Init()
{
try
{
s_DeltaVegaThresholdMap.put (
1,
new DeltaVegaThreshold (
1400.,
250.
)
);

s_DeltaVegaThresholdMap.put (
2,
new DeltaVegaThreshold (
20000.,
2000.
)
);

s_DeltaVegaThresholdMap.put (
3,
new DeltaVegaThreshold (
3500.,
510.
)
);

s_DeltaVegaThresholdMap.put (
4,
new DeltaVegaThreshold (
3500.,
510.
)
);

s_DeltaVegaThresholdMap.put (
5,
new DeltaVegaThreshold (
3500.,
510.
)
);

s_DeltaVegaThresholdMap.put (
6,
new DeltaVegaThreshold (
6400.,
1900.
)
);

s_DeltaVegaThresholdMap.put (
7,
new DeltaVegaThreshold (
6400.,
1900.
)
);

s_DeltaVegaThresholdMap.put (
8,
new DeltaVegaThreshold (
2500.,
870.
)
);

s_DeltaVegaThresholdMap.put (
9,
new DeltaVegaThreshold (
2500.,
870.
)
);

s_DeltaVegaThresholdMap.put (
10,
new DeltaVegaThreshold (
300.,
220.
)
);

s_DeltaVegaThresholdMap.put (
11,
new DeltaVegaThreshold (
2900.,
450.
)
);

s_DeltaVegaThresholdMap.put (
12,
new DeltaVegaThreshold (
7600.,
740.
)
);

s_DeltaVegaThresholdMap.put (
13,
new DeltaVegaThreshold (
3900.,
370.
)
);

s_DeltaVegaThresholdMap.put (
14,
new DeltaVegaThreshold (
3900.,
370.
)
);

s_DeltaVegaThresholdMap.put (
15,
new DeltaVegaThreshold (
3900.,
370.
)
);

s_DeltaVegaThresholdMap.put (
16,
new DeltaVegaThreshold (
300.,
220.
)
);

s_DeltaVegaThresholdMap.put (
17,
new DeltaVegaThreshold (
12000.,
430.
)
);
}
catch (Exception e)
{
try {
s_DeltaVegaThresholdMap.put (1, new DeltaVegaThreshold (1400., 250.));

s_DeltaVegaThresholdMap.put (2, new DeltaVegaThreshold (20000., 2000.));

s_DeltaVegaThresholdMap.put (3, new DeltaVegaThreshold (3500., 510.));

s_DeltaVegaThresholdMap.put (4, new DeltaVegaThreshold (3500., 510.));

s_DeltaVegaThresholdMap.put (5, new DeltaVegaThreshold (3500., 510.));

s_DeltaVegaThresholdMap.put (6, new DeltaVegaThreshold (6400., 1900.));

s_DeltaVegaThresholdMap.put (7, new DeltaVegaThreshold (6400., 1900.));

s_DeltaVegaThresholdMap.put (8, new DeltaVegaThreshold (2500., 870.));

s_DeltaVegaThresholdMap.put (9, new DeltaVegaThreshold (2500., 870.));

s_DeltaVegaThresholdMap.put (10, new DeltaVegaThreshold (300., 220.));

s_DeltaVegaThresholdMap.put (11, new DeltaVegaThreshold (2900., 450.));

s_DeltaVegaThresholdMap.put (12, new DeltaVegaThreshold (7600., 740.));

s_DeltaVegaThresholdMap.put (13, new DeltaVegaThreshold (3900., 370.));

s_DeltaVegaThresholdMap.put (14, new DeltaVegaThreshold (3900., 370.));

s_DeltaVegaThresholdMap.put (15, new DeltaVegaThreshold (3900., 370.));

s_DeltaVegaThresholdMap.put (16, new DeltaVegaThreshold (300., 220.));

s_DeltaVegaThresholdMap.put (17, new DeltaVegaThreshold (12000., 430.));
} catch (Exception e) {
e.printStackTrace();

return false;
Expand Down Expand Up @@ -308,9 +216,7 @@ public static final Set<Integer> BucketSet()
public static final boolean ContainsBucket (
final int bucketNumber)
{
return s_DeltaVegaThresholdMap.containsKey (
bucketNumber
);
return s_DeltaVegaThresholdMap.containsKey (bucketNumber);
}

/**
Expand All @@ -324,11 +230,7 @@ public static final boolean ContainsBucket (
public static final DeltaVegaThreshold Threshold (
final int bucketNumber)
{
return ContainsBucket (
bucketNumber
) ? s_DeltaVegaThresholdMap.get (
bucketNumber
) : null;
return ContainsBucket (bucketNumber) ? s_DeltaVegaThresholdMap.get (bucketNumber) : null;
}

/**
Expand Down
Loading

0 comments on commit b4aed3e

Please sign in to comment.