CRNQSettingsContainer20.java

  1. package org.drip.simm.credit;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

  5. /*!
  6.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  7.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  8.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  9.  *
  10.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  11.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  12.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  13.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  14.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  15.  *      and computational support.
  16.  *  
  17.  *      https://lakshmidrip.github.io/DROP/
  18.  *  
  19.  *  DROP is composed of three modules:
  20.  *  
  21.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  22.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  23.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  24.  *
  25.  *  DROP Product Core implements libraries for the following:
  26.  *  - Fixed Income Analytics
  27.  *  - Loan Analytics
  28.  *  - Transaction Cost Analytics
  29.  *
  30.  *  DROP Portfolio Core implements libraries for the following:
  31.  *  - Asset Allocation Analytics
  32.  *  - Asset Liability Management Analytics
  33.  *  - Capital Estimation Analytics
  34.  *  - Exposure Analytics
  35.  *  - Margin Analytics
  36.  *  - XVA Analytics
  37.  *
  38.  *  DROP Computational Core implements libraries for the following:
  39.  *  - Algorithm Support
  40.  *  - Computation Support
  41.  *  - Function Analysis
  42.  *  - Model Validation
  43.  *  - Numerical Analysis
  44.  *  - Numerical Optimizer
  45.  *  - Spline Builder
  46.  *  - Statistical Learning
  47.  *
  48.  *  Documentation for DROP is Spread Over:
  49.  *
  50.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  51.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  52.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  53.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  54.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  55.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  56.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  57.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  58.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  59.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  60.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  61.  *
  62.  *  Licensed under the Apache License, Version 2.0 (the "License");
  63.  *      you may not use this file except in compliance with the License.
  64.  *  
  65.  *  You may obtain a copy of the License at
  66.  *      http://www.apache.org/licenses/LICENSE-2.0
  67.  *  
  68.  *  Unless required by applicable law or agreed to in writing, software
  69.  *      distributed under the License is distributed on an "AS IS" BASIS,
  70.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  71.  *  
  72.  *  See the License for the specific language governing permissions and
  73.  *      limitations under the License.
  74.  */

  75. /**
  76.  * <i>CRNQSettingsContainer20</i> holds the ISDA SIMM 2.0 Credit Non-Qualifying Buckets. The References are:
  77.  *
  78.  * <br><br>
  79.  *  <ul>
  80.  *      <li>
  81.  *          Andersen, L. B. G., M. Pykhtin, and A. Sokol (2017): Credit Exposure in the Presence of Initial
  82.  *              Margin https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2806156 <b>eSSRN</b>
  83.  *      </li>
  84.  *      <li>
  85.  *          Albanese, C., S. Caenazzo, and O. Frankel (2017): Regression Sensitivities for Initial Margin
  86.  *              Calculations https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2763488 <b>eSSRN</b>
  87.  *      </li>
  88.  *      <li>
  89.  *          Anfuso, F., D. Aziz, P. Giltinan, and K. Loukopoulus (2017): A Sound Modeling and Back-testing
  90.  *              Framework for Forecasting Initial Margin Requirements
  91.  *                  https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2716279 <b>eSSRN</b>
  92.  *      </li>
  93.  *      <li>
  94.  *          Caspers, P., P. Giltinan, R. Lichters, and N. Nowaczyk (2017): Forecasting Initial Margin
  95.  *              Requirements - A Model Evaluation https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2911167
  96.  *                  <b>eSSRN</b>
  97.  *      </li>
  98.  *      <li>
  99.  *          International Swaps and Derivatives Association (2017): SIMM v2.0 Methodology
  100.  *              https://www.isda.org/a/oFiDE/isda-simm-v2.pdf
  101.  *      </li>
  102.  *  </ul>
  103.  *
  104.  * <br><br>
  105.  *  <ul>
  106.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  107.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/MarginAnalyticsLibrary.md">Initial and Variation Margin Analytics</a></li>
  108.  *      <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>
  109.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/simm/credit/README.md">Credit Qualifying/Non-Qualifying Risk Factor Settings</a></li>
  110.  *  </ul>
  111.  * <br><br>
  112.  *
  113.  * @author Lakshmi Krishnamurthy
  114.  */

  115. public class CRNQSettingsContainer20
  116. {
  117.     private static final java.util.Map<java.lang.Integer, org.drip.simm.credit.CRBucket> s_BucketMap = new
  118.         java.util.TreeMap<java.lang.Integer, org.drip.simm.credit.CRBucket>();

  119.     /**
  120.      * Initial the Credit Non-Qualifying Settings
  121.      *
  122.      * @return TRUE - The Credit Non-Qualifying Settings successfully initialized
  123.      */

  124.     public static final boolean Init()
  125.     {
  126.         try
  127.         {
  128.             s_BucketMap.put (
  129.                 -1,
  130.                 new org.drip.simm.credit.CRBucket (
  131.                     -1,
  132.                     org.drip.simm.credit.CRSystemics.CREDIT_QUALITY_UNSPECIFIED,
  133.                     org.drip.simm.credit.SectorSystemics.RESIDUAL,
  134.                     2000.
  135.                 )
  136.             );

  137.             s_BucketMap.put (
  138.                 1,
  139.                 new org.drip.simm.credit.CRBucket (
  140.                     1,
  141.                     org.drip.simm.credit.CRSystemics.CREDIT_QUALITY_INVESTMENT_GRADE,
  142.                     org.drip.simm.credit.SectorSystemics.RMBS_CMBS,
  143.                     140.
  144.                 )
  145.             );

  146.             s_BucketMap.put (
  147.                 2,
  148.                 new org.drip.simm.credit.CRBucket (
  149.                     2,
  150.                     org.drip.simm.credit.CRSystemics.CREDIT_QUALITY_HIGH_YIELD,
  151.                     org.drip.simm.credit.SectorSystemics.RMBS_CMBS,
  152.                     2000.
  153.                 )
  154.             );
  155.         }
  156.         catch (java.lang.Exception e)
  157.         {
  158.             e.printStackTrace();

  159.             return false;
  160.         }

  161.         return true;
  162.     }

  163.     /**
  164.      * Retrieve the Standard ISDA Credit Tenor Set
  165.      *
  166.      * @return The Standard ISDA Credit Tenor Set
  167.      */

  168.     public static final java.util.Set<java.lang.String> TenorSet()
  169.     {
  170.         java.util.Set<java.lang.String> tenorSet = new java.util.HashSet<java.lang.String>();

  171.         tenorSet.add ("1Y");

  172.         tenorSet.add ("2Y");

  173.         tenorSet.add ("3Y");

  174.         tenorSet.add ("5Y");

  175.         tenorSet.add ("10Y");

  176.         return tenorSet;
  177.     }

  178.     /**
  179.      * Retrieve the Set of Bucket Indexes available
  180.      *
  181.      * @return The Set of Bucket Indexes available
  182.      */

  183.     public static final java.util.Set<java.lang.Integer> BucketSet()
  184.     {
  185.         return s_BucketMap.keySet();
  186.     }

  187.     /**
  188.      * Indicate if the Bucket denoted by the Number is available
  189.      *
  190.      * @param bucketNumber The Bucket Number
  191.      *
  192.      * @return TRUE - The Bucket denoted by the Number is available
  193.      */

  194.     public static final boolean ContainsBucket (
  195.         final int bucketNumber)
  196.     {
  197.         return s_BucketMap.containsKey (bucketNumber);
  198.     }

  199.     /**
  200.      * Retrieve the Bucket denoted by the Number
  201.      *
  202.      * @param bucketNumber The Bucket Number
  203.      *
  204.      * @return The Bucket denoted by the Number
  205.      */

  206.     public static final org.drip.simm.credit.CRBucket Bucket (
  207.         final int bucketNumber)
  208.     {
  209.         return ContainsBucket (bucketNumber) ? s_BucketMap.get (bucketNumber) : null;
  210.     }

  211.     /**
  212.      * Retrieve the Bucket Map
  213.      *
  214.      * @return The Bucket Map
  215.      */

  216.     public static final java.util.Map<java.lang.Integer, org.drip.simm.credit.CRBucket> BucketMap()
  217.     {
  218.         return s_BucketMap;
  219.     }
  220. }