CollateralAmountEstimatorOutput.java

  1. package org.drip.exposure.mpor;

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

  76. /**
  77.  * <i>CollateralAmountEstimatorOutput</i> contains the Estimation Output of the Hypothecation Collateral that
  78.  * is to be Posted during a Single Run of a Collateral Hypothecation Group Valuation. The References are:
  79.  *  
  80.  * <br><br>
  81.  *      <ul>
  82.  *          <li>
  83.  *              Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-
  84.  *                  party Risk and Funding Costs <i>Journal of Credit Risk</i> <b>7 (3)</b> 1-19
  85.  *          </li>
  86.  *          <li>
  87.  *              Burgard, C., and M. Kjaer (2014): In the Balance, Risk, 24 (11) 72-75
  88.  *          </li>
  89.  *          <li>
  90.  *              Gregory, J. (2009): Being Two-faced over Counter-party Credit Risk <i>Risk</i> <b>20 (2)</b>
  91.  *                  86-90
  92.  *          </li>
  93.  *          <li>
  94.  *              Li, B., and Y. Tang (2007): Quantitative Analysis, Derivatives Modeling, and Trading
  95.  *                  Strategies in the Presence of Counter-party Credit Risk for the Fixed Income Market
  96.  *                  <i>World Scientific Publishing </i> <b>Singapore</b>
  97.  *          </li>
  98.  *          <li>
  99.  *              Piterbarg, V. (2010): Funding Beyond Discounting: Collateral Agreements and Derivatives
  100.  *                  Pricing <i>Risk</i> <b>21 (2)</b> 97-102
  101.  *          </li>
  102.  *          <li>
  103.  *      </ul>
  104.  *
  105.  *  <br><br>
  106.  *  <ul>
  107.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  108.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ExposureAnalyticsLibrary.md">Exposure Analytics</a></li>
  109.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/exposure/README.md">Exposure Group Level Collateralized/Uncollateralized Exposure</a></li>
  110.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/exposure/mpor/README.md">Margin Period Collateral Amount Estimation</a></li>
  111.  *  </ul>
  112.  *
  113.  * @author Lakshmi Krishnamurthy
  114.  */

  115. public class CollateralAmountEstimatorOutput
  116. {
  117.     private double _postingRequirement = java.lang.Double.NaN;
  118.     private double _clientWindowMarginValue = java.lang.Double.NaN;
  119.     private double _dealerWindowMarginValue = java.lang.Double.NaN;
  120.     private double _clientPostingRequirement = java.lang.Double.NaN;
  121.     private double _dealerPostingRequirement = java.lang.Double.NaN;
  122.     private double _clientCollateralThreshold = java.lang.Double.NaN;
  123.     private double _dealerCollateralThreshold = java.lang.Double.NaN;
  124.     private org.drip.analytics.date.JulianDate _clientMarginDate = null;
  125.     private org.drip.analytics.date.JulianDate _dealerMarginDate = null;

  126.     /**
  127.      * CollateralAmountEstimatorOutput Constructor
  128.      *
  129.      * @param dealerMarginDate The Dealer Margin Date
  130.      * @param clientMarginDate The Client Margin Date
  131.      * @param dealerWindowMarginValue The Margin Value at the Dealer Default Window
  132.      * @param dealerCollateralThreshold The Dealer Collateral Threshold
  133.      * @param dealerPostingRequirement The Dealer Collateral Posting Requirement
  134.      * @param clientWindowMarginValue The Margin Value at the Client Default Window
  135.      * @param clientCollateralThreshold The Client Collateral Threshold
  136.      * @param clientPostingRequirement The Client Collateral Posting Requirement
  137.      * @param postingRequirement The Total Collateral Posting Requirement
  138.      *
  139.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  140.      */

  141.     public CollateralAmountEstimatorOutput (
  142.         final org.drip.analytics.date.JulianDate dealerMarginDate,
  143.         final org.drip.analytics.date.JulianDate clientMarginDate,
  144.         final double dealerWindowMarginValue,
  145.         final double dealerCollateralThreshold,
  146.         final double dealerPostingRequirement,
  147.         final double clientWindowMarginValue,
  148.         final double clientCollateralThreshold,
  149.         final double clientPostingRequirement,
  150.         final double postingRequirement)
  151.         throws java.lang.Exception
  152.     {
  153.         if (null == (_dealerMarginDate = dealerMarginDate) ||
  154.             null == (_clientMarginDate = clientMarginDate) ||
  155.             !org.drip.numerical.common.NumberUtil.IsValid (_dealerWindowMarginValue = dealerWindowMarginValue) ||
  156.             !org.drip.numerical.common.NumberUtil.IsValid (_dealerCollateralThreshold =
  157.                 dealerCollateralThreshold) ||
  158.             !org.drip.numerical.common.NumberUtil.IsValid (_dealerPostingRequirement = dealerPostingRequirement)
  159.                 ||
  160.             !org.drip.numerical.common.NumberUtil.IsValid (_clientWindowMarginValue = clientWindowMarginValue) ||
  161.             !org.drip.numerical.common.NumberUtil.IsValid (_clientCollateralThreshold =
  162.                 clientCollateralThreshold) ||
  163.             !org.drip.numerical.common.NumberUtil.IsValid (_clientPostingRequirement = clientPostingRequirement)
  164.                 ||
  165.             !org.drip.numerical.common.NumberUtil.IsValid (_postingRequirement = postingRequirement))
  166.         {
  167.             throw new java.lang.Exception ("CollateralAmountEstimatorOutput Constructor => Invalid Inputs");
  168.         }
  169.     }

  170.     /**
  171.      * Retrieve the Dealer Margin Date
  172.      *
  173.      * @return The Dealer Margin Date
  174.      */

  175.     public org.drip.analytics.date.JulianDate dealerMarginDate()
  176.     {
  177.         return _dealerMarginDate;
  178.     }

  179.     /**
  180.      * Retrieve the Client Margin Date
  181.      *
  182.      * @return The Client Margin Date
  183.      */

  184.     public org.drip.analytics.date.JulianDate clientMarginDate()
  185.     {
  186.         return _clientMarginDate;
  187.     }

  188.     /**
  189.      * Retrieve the Margin Value at the Dealer Default Window
  190.      *
  191.      * @return The Margin Value at the Dealer Default Window
  192.      */

  193.     public double dealerWindowMarginValue()
  194.     {
  195.         return _dealerWindowMarginValue;
  196.     }

  197.     /**
  198.      * Retrieve the Dealer Collateral Threshold
  199.      *
  200.      * @return The Dealer Collateral Threshold
  201.      */

  202.     public double dealerCollateralThreshold()
  203.     {
  204.         return _dealerCollateralThreshold;
  205.     }

  206.     /**
  207.      * Retrieve the Dealer Posting Requirement
  208.      *
  209.      * @return The Dealer Posting Requirement
  210.      */

  211.     public double dealerPostingRequirement()
  212.     {
  213.         return _dealerPostingRequirement;
  214.     }

  215.     /**
  216.      * Retrieve the Margin Value at the Client Default Window
  217.      *
  218.      * @return The Margin Value at the Client Default Window
  219.      */

  220.     public double clientWindowMarginValue()
  221.     {
  222.         return _clientWindowMarginValue;
  223.     }

  224.     /**
  225.      * Retrieve the Client Collateral Threshold
  226.      *
  227.      * @return The Client Collateral Threshold
  228.      */

  229.     public double clientCollateralThreshold()
  230.     {
  231.         return _clientCollateralThreshold;
  232.     }

  233.     /**
  234.      * Retrieve the Client Posting Requirement
  235.      *
  236.      * @return The Client Posting Requirement
  237.      */

  238.     public double clientPostingRequirement()
  239.     {
  240.         return _clientPostingRequirement;
  241.     }

  242.     /**
  243.      * Retrieve the Total Collateral Posting Requirement
  244.      *
  245.      * @return The Total Collateral Posting Requirement
  246.      */

  247.     public double postingRequirement()
  248.     {
  249.         return _postingRequirement;
  250.     }
  251. }