SensitivityAggregateIR.java

  1. package org.drip.simm.margin;

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

  117. public class SensitivityAggregateIR
  118. {
  119.     private double _marginCovariance_OIS_OIS = java.lang.Double.NaN;
  120.     private double _marginCovariance_OIS_PRIME = java.lang.Double.NaN;
  121.     private double _marginCovariance_OIS_LIBOR1M = java.lang.Double.NaN;
  122.     private double _marginCovariance_OIS_LIBOR3M = java.lang.Double.NaN;
  123.     private double _marginCovariance_OIS_LIBOR6M = java.lang.Double.NaN;
  124.     private double _marginCovariance_OIS_LIBOR12M = java.lang.Double.NaN;
  125.     private double _marginCovariance_OIS_MUNICIPAL = java.lang.Double.NaN;

  126.     private double _marginCovariance_LIBOR1M_PRIME = java.lang.Double.NaN;
  127.     private double _marginCovariance_LIBOR1M_LIBOR1M = java.lang.Double.NaN;
  128.     private double _marginCovariance_LIBOR1M_LIBOR3M = java.lang.Double.NaN;
  129.     private double _marginCovariance_LIBOR1M_LIBOR6M = java.lang.Double.NaN;
  130.     private double _marginCovariance_LIBOR1M_LIBOR12M = java.lang.Double.NaN;
  131.     private double _marginCovariance_LIBOR1M_MUNICIPAL = java.lang.Double.NaN;

  132.     private double _marginCovariance_LIBOR3M_PRIME = java.lang.Double.NaN;
  133.     private double _marginCovariance_LIBOR3M_LIBOR3M = java.lang.Double.NaN;
  134.     private double _marginCovariance_LIBOR3M_LIBOR6M = java.lang.Double.NaN;
  135.     private double _marginCovariance_LIBOR3M_LIBOR12M = java.lang.Double.NaN;
  136.     private double _marginCovariance_LIBOR3M_MUNICIPAL = java.lang.Double.NaN;

  137.     private double _marginCovariance_LIBOR6M_PRIME = java.lang.Double.NaN;
  138.     private double _marginCovariance_LIBOR6M_LIBOR6M = java.lang.Double.NaN;
  139.     private double _marginCovariance_LIBOR6M_LIBOR12M = java.lang.Double.NaN;
  140.     private double _marginCovariance_LIBOR6M_MUNICIPAL = java.lang.Double.NaN;

  141.     private double _marginCovariance_LIBOR12M_PRIME = java.lang.Double.NaN;
  142.     private double _marginCovariance_LIBOR12M_LIBOR12M = java.lang.Double.NaN;
  143.     private double _marginCovariance_LIBOR12M_MUNICIPAL = java.lang.Double.NaN;

  144.     private double _marginCovariance_PRIME_PRIME = java.lang.Double.NaN;
  145.     private double _marginCovariance_PRIME_MUNICIPAL = java.lang.Double.NaN;

  146.     private double _marginCovariance_MUNICIPAL_MUNICIPAL = java.lang.Double.NaN;

  147.     private double _cumulativeMarginSensitivity = java.lang.Double.NaN;

  148.     /**
  149.      * SensitivityAggregateIR Constructor
  150.      *
  151.      * @param marginCovariance_OIS_OIS The OIS - OIS Margin Co-variance
  152.      * @param marginCovariance_OIS_LIBOR1M The OIS - LIBOR1M Margin Co-variance
  153.      * @param marginCovariance_OIS_LIBOR3M The OIS - LIBOR3M Margin Co-variance
  154.      * @param marginCovariance_OIS_LIBOR6M The OIS - LIBOR6M Margin Co-variance
  155.      * @param marginCovariance_OIS_LIBOR12M The OIS - LIBOR12M Margin Co-variance
  156.      * @param marginCovariance_OIS_PRIME The OIS - PRIME Margin Co-variance
  157.      * @param marginCovariance_OIS_MUNICIPAL The OIS - MUNICIPAL Margin Co-variance
  158.      * @param marginCovariance_LIBOR1M_LIBOR1M The LIBOR1M - LIBOR1M Margin Co-variance
  159.      * @param marginCovariance_LIBOR1M_LIBOR3M The LIBOR1M - LIBOR3M Margin Co-variance
  160.      * @param marginCovariance_LIBOR1M_LIBOR6M The LIBOR1M - LIBOR6M Margin Co-variance
  161.      * @param marginCovariance_LIBOR1M_LIBOR12M The LIBOR1M - LIBOR12M Margin Co-variance
  162.      * @param marginCovariance_LIBOR1M_PRIME The LIBOR1M - PRIME Margin Co-variance
  163.      * @param marginCovariance_LIBOR1M_MUNICIPAL The LIBOR1M - MUNICIPAL Margin Co-variance
  164.      * @param marginCovariance_LIBOR3M_LIBOR3M The LIBOR3M - LIBOR3M Margin Co-variance
  165.      * @param marginCovariance_LIBOR3M_LIBOR6M The LIBOR3M - LIBOR6M Margin Co-variance
  166.      * @param marginCovariance_LIBOR3M_LIBOR12M The LIBOR3M - LIBOR12M Margin Co-variance
  167.      * @param marginCovariance_LIBOR3M_PRIME The LIBOR3M - PRIME Margin Co-variance
  168.      * @param marginCovariance_LIBOR3M_MUNICIPAL The LIBOR3M - MUNICIPAL Margin Co-variance
  169.      * @param marginCovariance_LIBOR6M_LIBOR6M The LIBOR6M - LIBOR6M Margin Co-variance
  170.      * @param marginCovariance_LIBOR6M_LIBOR12M The LIBOR6M - LIBOR12M Margin Co-variance
  171.      * @param marginCovariance_LIBOR6M_PRIME The LIBOR6M - PRIME Margin Co-variance
  172.      * @param marginCovariance_LIBOR6M_MUNICIPAL The LIBOR6M - MUNICIPAL Margin Co-variance
  173.      * @param marginCovariance_LIBOR12M_LIBOR12M The LIBOR12M - LIBOR12M Margin Co-variance
  174.      * @param marginCovariance_LIBOR12M_PRIME The LIBOR12M - PRIME Margin Co-variance
  175.      * @param marginCovariance_LIBOR12M_MUNICIPAL The LIBOR12M - MUNICIPAL Margin Co-variance
  176.      * @param marginCovariance_PRIME_PRIME The PRIME - PRIME Margin Co-variance
  177.      * @param marginCovariance_PRIME_MUNICIPAL The PRIME - MUNICIPAL Margin Co-variance
  178.      * @param marginCovariance_MUNICIPAL_MUNICIPAL The MUNICIPAL - MUNICIPAL Margin Co-variance
  179.      * @param cumulativeMarginSensitivity The Cumulative Margin Sensitivity
  180.      *
  181.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  182.      */

  183.     public SensitivityAggregateIR (
  184.         final double marginCovariance_OIS_OIS,
  185.         final double marginCovariance_OIS_LIBOR1M,
  186.         final double marginCovariance_OIS_LIBOR3M,
  187.         final double marginCovariance_OIS_LIBOR6M,
  188.         final double marginCovariance_OIS_LIBOR12M,
  189.         final double marginCovariance_OIS_PRIME,
  190.         final double marginCovariance_OIS_MUNICIPAL,
  191.         final double marginCovariance_LIBOR1M_LIBOR1M,
  192.         final double marginCovariance_LIBOR1M_LIBOR3M,
  193.         final double marginCovariance_LIBOR1M_LIBOR6M,
  194.         final double marginCovariance_LIBOR1M_LIBOR12M,
  195.         final double marginCovariance_LIBOR1M_PRIME,
  196.         final double marginCovariance_LIBOR1M_MUNICIPAL,
  197.         final double marginCovariance_LIBOR3M_LIBOR3M,
  198.         final double marginCovariance_LIBOR3M_LIBOR6M,
  199.         final double marginCovariance_LIBOR3M_LIBOR12M,
  200.         final double marginCovariance_LIBOR3M_PRIME,
  201.         final double marginCovariance_LIBOR3M_MUNICIPAL,
  202.         final double marginCovariance_LIBOR6M_LIBOR6M,
  203.         final double marginCovariance_LIBOR6M_LIBOR12M,
  204.         final double marginCovariance_LIBOR6M_PRIME,
  205.         final double marginCovariance_LIBOR6M_MUNICIPAL,
  206.         final double marginCovariance_LIBOR12M_LIBOR12M,
  207.         final double marginCovariance_LIBOR12M_PRIME,
  208.         final double marginCovariance_LIBOR12M_MUNICIPAL,
  209.         final double marginCovariance_PRIME_PRIME,
  210.         final double marginCovariance_PRIME_MUNICIPAL,
  211.         final double marginCovariance_MUNICIPAL_MUNICIPAL,
  212.         final double cumulativeMarginSensitivity)
  213.         throws java.lang.Exception
  214.     {
  215.         if (!org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_OIS =
  216.                 marginCovariance_OIS_OIS) ||
  217.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_LIBOR1M =
  218.                 marginCovariance_OIS_LIBOR1M) ||
  219.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_LIBOR3M =
  220.                 marginCovariance_OIS_LIBOR3M) ||
  221.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_LIBOR6M =
  222.                 marginCovariance_OIS_LIBOR6M) ||
  223.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_LIBOR12M =
  224.                 marginCovariance_OIS_LIBOR12M) ||
  225.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_PRIME =
  226.                 marginCovariance_OIS_PRIME) ||
  227.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_OIS_MUNICIPAL =
  228.                 marginCovariance_OIS_MUNICIPAL) ||
  229.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR1M_LIBOR1M =
  230.                 marginCovariance_LIBOR1M_LIBOR1M) ||
  231.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR1M_LIBOR3M =
  232.                 marginCovariance_LIBOR1M_LIBOR3M) ||
  233.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR1M_LIBOR6M =
  234.                 marginCovariance_LIBOR1M_LIBOR6M) ||
  235.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR1M_LIBOR12M =
  236.                 marginCovariance_LIBOR1M_LIBOR12M) ||
  237.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR1M_PRIME =
  238.                 marginCovariance_LIBOR1M_PRIME) ||
  239.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR1M_MUNICIPAL =
  240.                 marginCovariance_LIBOR1M_MUNICIPAL) ||
  241.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR3M_LIBOR3M =
  242.                 marginCovariance_LIBOR3M_LIBOR3M) ||
  243.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR3M_LIBOR6M =
  244.                 marginCovariance_LIBOR3M_LIBOR6M) ||
  245.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR3M_LIBOR12M =
  246.                 marginCovariance_LIBOR3M_LIBOR12M) ||
  247.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR3M_PRIME =
  248.                 marginCovariance_LIBOR3M_PRIME) ||
  249.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR3M_MUNICIPAL =
  250.                 marginCovariance_LIBOR3M_MUNICIPAL) ||
  251.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR6M_LIBOR6M =
  252.                 marginCovariance_LIBOR6M_LIBOR6M) ||
  253.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR6M_LIBOR12M =
  254.                 marginCovariance_LIBOR6M_LIBOR12M) ||
  255.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR6M_PRIME =
  256.                 marginCovariance_LIBOR6M_PRIME) ||
  257.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR6M_MUNICIPAL =
  258.                 marginCovariance_LIBOR6M_MUNICIPAL) ||
  259.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR12M_LIBOR12M =
  260.                 marginCovariance_LIBOR12M_LIBOR12M) ||
  261.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR12M_PRIME =
  262.                 marginCovariance_LIBOR12M_PRIME) ||
  263.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_LIBOR12M_MUNICIPAL =
  264.                 marginCovariance_LIBOR12M_MUNICIPAL) ||
  265.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_PRIME_PRIME =
  266.                 marginCovariance_PRIME_PRIME) ||
  267.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_PRIME_MUNICIPAL =
  268.                 marginCovariance_PRIME_MUNICIPAL) ||
  269.             !org.drip.numerical.common.NumberUtil.IsValid (_marginCovariance_MUNICIPAL_MUNICIPAL =
  270.                 marginCovariance_MUNICIPAL_MUNICIPAL) ||
  271.             !org.drip.numerical.common.NumberUtil.IsValid (_cumulativeMarginSensitivity =
  272.                 cumulativeMarginSensitivity))
  273.         {
  274.             throw new java.lang.Exception ("SensitivityAggregateIR Constructor => Invalid Inputs");
  275.         }
  276.     }

  277.     /**
  278.      * Retrieve the OIS - OIS Margin Co-variance
  279.      *
  280.      * @return The OIS - OIS Margin Co-variance
  281.      */

  282.     public double marginCovariance_OIS_OIS()
  283.     {
  284.         return _marginCovariance_OIS_OIS;
  285.     }

  286.     /**
  287.      * Retrieve the OIS - LIBOR1M Margin Co-variance
  288.      *
  289.      * @return The OIS - LIBOR1M Margin Co-variance
  290.      */

  291.     public double marginCovariance_OIS_LIBOR1M()
  292.     {
  293.         return _marginCovariance_OIS_LIBOR1M;
  294.     }

  295.     /**
  296.      * Retrieve the OIS - LIBOR3M Margin Co-variance
  297.      *
  298.      * @return The OIS - LIBOR3M Margin Co-variance
  299.      */

  300.     public double marginCovariance_OIS_LIBOR3M()
  301.     {
  302.         return _marginCovariance_OIS_LIBOR3M;
  303.     }

  304.     /**
  305.      * Retrieve the OIS - LIBOR6M Margin Co-variance
  306.      *
  307.      * @return The OIS - LIBOR6M Margin Co-variance
  308.      */

  309.     public double marginCovariance_OIS_LIBOR6M()
  310.     {
  311.         return _marginCovariance_OIS_LIBOR6M;
  312.     }

  313.     /**
  314.      * Retrieve the OIS - LIBOR12M Margin Co-variance
  315.      *
  316.      * @return The OIS - LIBOR12M Margin Co-variance
  317.      */

  318.     public double marginCovariance_OIS_LIBOR12M()
  319.     {
  320.         return _marginCovariance_OIS_LIBOR12M;
  321.     }

  322.     /**
  323.      * Retrieve the OIS - PRIME Margin Co-variance
  324.      *
  325.      * @return The OIS - PRIME Margin Co-variance
  326.      */

  327.     public double marginCovariance_OIS_PRIME()
  328.     {
  329.         return _marginCovariance_OIS_PRIME;
  330.     }

  331.     /**
  332.      * Retrieve the OIS - MUNICIPAL Margin Co-variance
  333.      *
  334.      * @return The OIS - MUNICIPAL Margin Co-variance
  335.      */

  336.     public double marginCovariance_OIS_MUNICIPAL()
  337.     {
  338.         return _marginCovariance_OIS_MUNICIPAL;
  339.     }

  340.     /**
  341.      * Retrieve the LIBOR1M - LIBOR1M Margin Co-variance
  342.      *
  343.      * @return The LIBOR1M - LIBOR1M Margin Co-variance
  344.      */

  345.     public double marginCovariance_LIBOR1M_LIBOR1M()
  346.     {
  347.         return _marginCovariance_LIBOR1M_LIBOR1M;
  348.     }

  349.     /**
  350.      * Retrieve the LIBOR1M - LIBOR3M Margin Co-variance
  351.      *
  352.      * @return The LIBOR1M - LIBOR3M Margin Co-variance
  353.      */

  354.     public double marginCovariance_LIBOR1M_LIBOR3M()
  355.     {
  356.         return _marginCovariance_LIBOR1M_LIBOR3M;
  357.     }

  358.     /**
  359.      * Retrieve the LIBOR1M - LIBOR6M Margin Co-variance
  360.      *
  361.      * @return The LIBOR1M - LIBOR6M Margin Co-variance
  362.      */

  363.     public double marginCovariance_LIBOR1M_LIBOR6M()
  364.     {
  365.         return _marginCovariance_LIBOR1M_LIBOR6M;
  366.     }

  367.     /**
  368.      * Retrieve the LIBOR1M - LIBOR12M Margin Co-variance
  369.      *
  370.      * @return The LIBOR1M - LIBOR12M Margin Co-variance
  371.      */

  372.     public double marginCovariance_LIBOR1M_LIBOR12M()
  373.     {
  374.         return _marginCovariance_LIBOR1M_LIBOR12M;
  375.     }

  376.     /**
  377.      * Retrieve the LIBOR1M - PRIME Margin Co-variance
  378.      *
  379.      * @return The LIBOR1M - PRIME Margin Co-variance
  380.      */

  381.     public double marginCovariance_LIBOR1M_PRIME()
  382.     {
  383.         return _marginCovariance_LIBOR1M_PRIME;
  384.     }

  385.     /**
  386.      * Retrieve the LIBOR1M - MUNICIPAL Margin Co-variance
  387.      *
  388.      * @return The LIBOR1M - MUNICIPAL Margin Co-variance
  389.      */

  390.     public double marginCovariance_LIBOR1M_MUNICIPAL()
  391.     {
  392.         return _marginCovariance_LIBOR1M_MUNICIPAL;
  393.     }

  394.     /**
  395.      * Retrieve the LIBOR3M - LIBOR3M Margin Co-variance
  396.      *
  397.      * @return The LIBOR3M - LIBOR3M Margin Co-variance
  398.      */

  399.     public double marginCovariance_LIBOR3M_LIBOR3M()
  400.     {
  401.         return _marginCovariance_LIBOR3M_LIBOR3M;
  402.     }

  403.     /**
  404.      * Retrieve the LIBOR3M - LIBOR6M Margin Co-variance
  405.      *
  406.      * @return The LIBOR3M - LIBOR6M Margin Co-variance
  407.      */

  408.     public double marginCovariance_LIBOR3M_LIBOR6M()
  409.     {
  410.         return _marginCovariance_LIBOR3M_LIBOR6M;
  411.     }

  412.     /**
  413.      * Retrieve the LIBOR3M - LIBOR12M Margin Co-variance
  414.      *
  415.      * @return The LIBOR3M - LIBOR12M Margin Co-variance
  416.      */

  417.     public double marginCovariance_LIBOR3M_LIBOR12M()
  418.     {
  419.         return _marginCovariance_LIBOR3M_LIBOR12M;
  420.     }

  421.     /**
  422.      * Retrieve the LIBOR3M - PRIME Margin Co-variance
  423.      *
  424.      * @return The LIBOR3M - PRIME Margin Co-variance
  425.      */

  426.     public double marginCovariance_LIBOR3M_PRIME()
  427.     {
  428.         return _marginCovariance_LIBOR3M_PRIME;
  429.     }

  430.     /**
  431.      * Retrieve the LIBOR3M - MUNICIPAL Margin Co-variance
  432.      *
  433.      * @return The LIBOR3M - MUNICIPAL Margin Co-variance
  434.      */

  435.     public double marginCovariance_LIBOR3M_MUNICIPAL()
  436.     {
  437.         return _marginCovariance_LIBOR3M_MUNICIPAL;
  438.     }

  439.     /**
  440.      * Retrieve the LIBOR6M - LIBOR6M Margin Co-variance
  441.      *
  442.      * @return The LIBOR6M - LIBOR6M Margin Co-variance
  443.      */

  444.     public double marginCovariance_LIBOR6M_LIBOR6M()
  445.     {
  446.         return _marginCovariance_LIBOR6M_LIBOR6M;
  447.     }

  448.     /**
  449.      * Retrieve the LIBOR6M - LIBOR12M Margin Co-variance
  450.      *
  451.      * @return The LIBOR6M - LIBOR12M Margin Co-variance
  452.      */

  453.     public double marginCovariance_LIBOR6M_LIBOR12M()
  454.     {
  455.         return _marginCovariance_LIBOR6M_LIBOR12M;
  456.     }

  457.     /**
  458.      * Retrieve the LIBOR6M - PRIME Margin Co-variance
  459.      *
  460.      * @return The LIBOR6M - PRIME Margin Co-variance
  461.      */

  462.     public double marginCovariance_LIBOR6M_PRIME()
  463.     {
  464.         return _marginCovariance_LIBOR6M_PRIME;
  465.     }

  466.     /**
  467.      * Retrieve the LIBOR6M - MUNICIPAL Margin Co-variance
  468.      *
  469.      * @return The LIBOR6M - MUNICIPAL Margin Co-variance
  470.      */

  471.     public double marginCovariance_LIBOR6M_MUNICIPAL()
  472.     {
  473.         return _marginCovariance_LIBOR6M_MUNICIPAL;
  474.     }

  475.     /**
  476.      * Retrieve the LIBOR12M - LIBOR12M Margin Co-variance
  477.      *
  478.      * @return The LIBOR12M - LIBOR12M Margin Co-variance
  479.      */

  480.     public double marginCovariance_LIBOR12M_LIBOR12M()
  481.     {
  482.         return _marginCovariance_LIBOR12M_LIBOR12M;
  483.     }

  484.     /**
  485.      * Retrieve the LIBOR12M - PRIME Margin Co-variance
  486.      *
  487.      * @return The LIBOR12M - PRIME Margin Co-variance
  488.      */

  489.     public double marginCovariance_LIBOR12M_PRIME()
  490.     {
  491.         return _marginCovariance_LIBOR12M_PRIME;
  492.     }

  493.     /**
  494.      * Retrieve the LIBOR12M - MUNICIPAL Margin Co-variance
  495.      *
  496.      * @return The LIBOR12M - MUNICIPAL Margin Co-variance
  497.      */

  498.     public double marginCovariance_LIBOR12M_MUNICIPAL()
  499.     {
  500.         return _marginCovariance_LIBOR12M_MUNICIPAL;
  501.     }

  502.     /**
  503.      * Retrieve the PRIME - PRIME Margin Co-variance
  504.      *
  505.      * @return The PRIME - PRIME Margin Co-variance
  506.      */

  507.     public double marginCovariance_PRIME_PRIME()
  508.     {
  509.         return _marginCovariance_PRIME_PRIME;
  510.     }

  511.     /**
  512.      * Retrieve the PRIME - MUNICIPAL Margin Co-variance
  513.      *
  514.      * @return The PRIME - MUNICIPAL Margin Co-variance
  515.      */

  516.     public double marginCovariance_PRIME_MUNICIPAL()
  517.     {
  518.         return _marginCovariance_PRIME_MUNICIPAL;
  519.     }

  520.     /**
  521.      * Retrieve the MUNICIPAL - MUNICIPAL Margin Co-variance
  522.      *
  523.      * @return The MUNICIPAL - MUNICIPAL Margin Co-variance
  524.      */

  525.     public double marginCovariance_MUNICIPAL_MUNICIPAL()
  526.     {
  527.         return _marginCovariance_MUNICIPAL_MUNICIPAL;
  528.     }

  529.     /**
  530.      * Compute the Cumulative Margin Covariance
  531.      *
  532.      * @return The Cumulative Margin Covariance
  533.      */

  534.     public double cumulativeMarginCovariance()
  535.     {
  536.         return _marginCovariance_OIS_OIS +
  537.             _marginCovariance_OIS_PRIME +
  538.             _marginCovariance_OIS_LIBOR1M +
  539.             _marginCovariance_OIS_LIBOR3M +
  540.             _marginCovariance_OIS_LIBOR6M +
  541.             _marginCovariance_OIS_LIBOR12M +
  542.             _marginCovariance_OIS_MUNICIPAL +
  543.             _marginCovariance_LIBOR1M_PRIME +
  544.             _marginCovariance_LIBOR1M_LIBOR1M +
  545.             _marginCovariance_LIBOR1M_LIBOR3M +
  546.             _marginCovariance_LIBOR1M_LIBOR6M +
  547.             _marginCovariance_LIBOR1M_LIBOR12M +
  548.             _marginCovariance_LIBOR1M_MUNICIPAL +
  549.             _marginCovariance_LIBOR3M_PRIME +
  550.             _marginCovariance_LIBOR3M_LIBOR3M +
  551.             _marginCovariance_LIBOR3M_LIBOR6M +
  552.             _marginCovariance_LIBOR3M_LIBOR12M +
  553.             _marginCovariance_LIBOR3M_MUNICIPAL +
  554.             _marginCovariance_LIBOR6M_PRIME +
  555.             _marginCovariance_LIBOR6M_LIBOR6M +
  556.             _marginCovariance_LIBOR6M_LIBOR12M +
  557.             _marginCovariance_LIBOR6M_MUNICIPAL +
  558.             _marginCovariance_LIBOR12M_PRIME +
  559.             _marginCovariance_LIBOR12M_LIBOR12M +
  560.             _marginCovariance_LIBOR12M_MUNICIPAL +
  561.             _marginCovariance_PRIME_PRIME +
  562.             _marginCovariance_PRIME_MUNICIPAL +
  563.             _marginCovariance_MUNICIPAL_MUNICIPAL;
  564.     }

  565.     /**
  566.      * Compute the Cumulative Sensitivity Margin
  567.      *
  568.      * @return The Cumulative Sensitivity Margin
  569.      */

  570.     public double cumulativeMargin()
  571.     {
  572.         return java.lang.Math.sqrt (cumulativeMarginCovariance());
  573.     }

  574.     /**
  575.      * Retrieve the Cumulative Margin Sensitivity
  576.      *
  577.      * @return The Cumulative Margin Sensitivity
  578.      */

  579.     public double cumulativeMarginSensitivity()
  580.     {
  581.         return _cumulativeMarginSensitivity;
  582.     }
  583. }