ScenarioMarketParams.java

  1. package org.drip.param.definition;

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

  81. /**
  82.  * <i>ScenarioMarketParams</i> is the place holder for the comprehensive suite of the market set of curves
  83.  * for the given date. It exports the following functionality:
  84.  *
  85.  * <br><br>
  86.  *  <ul>
  87.  *      <li>
  88.  *          Add/remove/retrieve scenario discount curve
  89.  *      </li>
  90.  *      <li>
  91.  *          Add/remove/retrieve scenario forward curve
  92.  *      </li>
  93.  *      <li>
  94.  *          Add/remove/retrieve scenario zero curve
  95.  *      </li>
  96.  *      <li>
  97.  *          Add/remove/retrieve scenario credit curve
  98.  *      </li>
  99.  *      <li>
  100.  *          Add/remove/retrieve scenario recovery curve
  101.  *      </li>
  102.  *      <li>
  103.  *          Add/remove/retrieve scenario FXForward curve
  104.  *      </li>
  105.  *      <li>
  106.  *          Add/remove/retrieve scenario FXBasis curve
  107.  *      </li>
  108.  *      <li>
  109.  *          Add/remove/retrieve scenario fixings
  110.  *      </li>
  111.  *      <li>
  112.  *          Add/remove/retrieve Treasury/component quotes
  113.  *      </li>
  114.  *      <li>
  115.  *          Retrieve scenario Market Parameters
  116.  *      </li>
  117.  *      <li>
  118.  *          Retrieve map of flat rates/credit/recovery Market Parameters
  119.  *      </li>
  120.  *      <li>
  121.  *          Retrieve double map of tenor rates/credit/recovery Market Parameters
  122.  *      </li>
  123.  *      <li>
  124.  *          Retrieve rates/credit scenario generator
  125.  *      </li>
  126.  *  </ul>
  127.  *
  128.  *  <br><br>
  129.  *  <ul>
  130.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  131.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  132.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/param/README.md">Product Cash Flow, Valuation, Market, Pricing, and Quoting Parameters</a></li>
  133.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/param/definition/README.md">Latent State Quantification Metrics Tweak</a></li>
  134.  *  </ul>
  135.  *
  136.  * @author Lakshmi Krishnamurthy
  137.  */

  138. public abstract class ScenarioMarketParams {

  139.     /**
  140.      * Add the named scenario DC
  141.      *
  142.      * @param strName Name
  143.      * @param dcsc Corresponding DiscountCurveScenarioContainer instance
  144.      *
  145.      * @return Added successfully (true)
  146.      */

  147.     public abstract boolean addScenarioDiscountCurve (
  148.         final java.lang.String strName,
  149.         final org.drip.param.market.DiscountCurveScenarioContainer dcsc);

  150.     /**
  151.      * Remove the named scenario DC
  152.      *
  153.      * @param strName Name
  154.      *
  155.      * @return Removed successfully (true)
  156.      */

  157.     public abstract boolean removeScenarioDiscountCurve (
  158.         final java.lang.String strName);

  159.     /**
  160.      * Add the named scenario CC
  161.      *
  162.      * @param strName Name
  163.      * @param scc ScenarioCreditCurve Instance
  164.      *
  165.      * @return Added successfully (true)
  166.      */

  167.     public abstract boolean addScenarioCreditCurve (
  168.         final java.lang.String strName,
  169.         final org.drip.param.market.CreditCurveScenarioContainer scc);

  170.     /**
  171.      * Removes the named scenario CC
  172.      *
  173.      * @param strName Name
  174.      *
  175.      * @return Removed successfully (true)
  176.      */

  177.     public abstract boolean removeScenarioCreditCurve (
  178.         final java.lang.String strName);

  179.     /**
  180.      * Add the named Treasury Quote
  181.      *
  182.      * @param strBenchmark Name
  183.      * @param pqTSY Treasury Quote
  184.      *
  185.      * @return Added successfully (true)
  186.      */

  187.     public abstract boolean addTSYQuote (
  188.         final java.lang.String strBenchmark,
  189.         final org.drip.param.definition.ProductQuote pqTSY);

  190.     /**
  191.      * Remove the named Treasury Quote
  192.      *
  193.      * @param strBenchmark Name
  194.      *
  195.      * @return Removed successfully (true)
  196.      */

  197.     public abstract boolean removeTSYQuote (
  198.         final java.lang.String strBenchmark);

  199.     /**
  200.      * Set the full set of named Treasury Quote Map
  201.      *
  202.      * @param mapCQTSY Named Treasury Quote Map
  203.      *
  204.      * @return Set successfully (true)
  205.      */

  206.     public abstract boolean setTSYQuotes (
  207.         final org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.definition.ProductQuote>
  208.             mapCQTSY);

  209.     /**
  210.      * Get the named Treasury Quote Map corresponding to the desired benchmark
  211.      *
  212.      * @param strBenchmark The treasury benchmark
  213.      *
  214.      * @return Treasury Quote
  215.      */

  216.     public abstract org.drip.param.definition.ProductQuote tsyQuote (
  217.         final java.lang.String strBenchmark);

  218.     /**
  219.      * Get the full set of named Treasury Quote Map
  220.      *
  221.      * @return Named Treasury Quote Map
  222.      */

  223.     public abstract org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.definition.ProductQuote>
  224.         tsyQuotes();

  225.     /**
  226.      * Add the fixing for the given Latent State Label and the given date
  227.      *
  228.      * @param dtFix The fixing date
  229.      * @param lsl The Latent State Label
  230.      * @param dblFixing The fixing
  231.      *
  232.      * @return Added successfully (true)
  233.      */

  234.     public abstract boolean addFixing (
  235.         final org.drip.analytics.date.JulianDate dtFix,
  236.         final org.drip.state.identifier.LatentStateLabel lsl,
  237.         final double dblFixing);

  238.     /**
  239.      * Remove the fixing corresponding to the given date and the Latent State Label
  240.      *
  241.      * @param dtFix Fixing date
  242.      * @param lsl The Latent State label
  243.      *
  244.      * @return Successfully removed (true)
  245.      */

  246.     public abstract boolean removeFixing (
  247.         final org.drip.analytics.date.JulianDate dtFix,
  248.         final org.drip.state.identifier.LatentStateLabel lsl);

  249.     /**
  250.      * Retrieve the Latent State Fixings Container
  251.      *
  252.      * @return The Latent State Fixings Container
  253.      */

  254.     public abstract org.drip.param.market.LatentStateFixingsContainer fixings();

  255.     /**
  256.      * Add the component quote
  257.      *
  258.      * @param strComponentID Component ID
  259.      * @param cqComponent Component Quote
  260.      *
  261.      * @return Added successfully (true)
  262.      */

  263.     public abstract boolean addComponentQuote (
  264.         final java.lang.String strComponentID,
  265.         final org.drip.param.definition.ProductQuote cqComponent);

  266.     /**
  267.      * Remove the component quote
  268.      *
  269.      * @param strComponentID Component ID
  270.      *
  271.      * @return Removed successfully (true)
  272.      */

  273.     public abstract boolean removeComponentQuote (
  274.         final java.lang.String strComponentID);

  275.     /**
  276.      * Add the full map of component quotes
  277.      *
  278.      * @param mapComponentQuote Map of Component Quotes
  279.      *
  280.      * @return Added successfully (true)
  281.      */

  282.     public abstract boolean addComponentQuote (
  283.         final org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.definition.ProductQuote>
  284.             mapComponentQuote);

  285.     /**
  286.      * Retrieve the quote for the given component
  287.      *
  288.      * @param strComponentID Component ID
  289.      *
  290.      * @return ComponentQuote
  291.      */

  292.     public abstract org.drip.param.definition.ProductQuote componentQuote (
  293.         final java.lang.String strComponentID);

  294.     /**
  295.      * Retrieve the full map of component quotes
  296.      *
  297.      * @return The Map of Component Quotes
  298.      */

  299.     public abstract org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.definition.ProductQuote>
  300.         componentQuotes();

  301.     /**
  302.      * Add the named scenario Market Parameters
  303.      *
  304.      * @param strScenarioName Scenario Name
  305.      * @param csqs Market Parameters
  306.      *
  307.      * @return True - Added successfully
  308.      */

  309.     public abstract boolean addScenarioMarketParams (
  310.         final java.lang.String strScenarioName,
  311.         final org.drip.param.market.CurveSurfaceQuoteContainer csqs);

  312.     /**
  313.      * Retrieve the Named Scenario Market Parameters
  314.      *
  315.      * @param strScenarioName Scenario Name
  316.      *
  317.      * @return Named Market Parameters
  318.      */

  319.     public abstract org.drip.param.market.CurveSurfaceQuoteContainer scenarioMarketParams (
  320.         final java.lang.String strScenarioName);

  321.     /**
  322.      * Get the Market Parameters corresponding to the component and the scenario
  323.      *
  324.      * @param comp Component
  325.      * @param strScenario Scenario
  326.      *
  327.      * @return The Market Parameters
  328.      */

  329.     public abstract org.drip.param.market.CurveSurfaceQuoteContainer scenarioMarketParams (
  330.         final org.drip.product.definition.Component comp,
  331.         final java.lang.String strScenario);

  332.     /**
  333.      * Get the Map of Funding Tenor Bumped Market Parameters corresponding to the Component
  334.      *
  335.      * @param comp Component
  336.      * @param bBumpUp TRUE - Bump Up
  337.      *
  338.      * @return Map of the Funding Tenor Bumped Market Parameters
  339.      */

  340.     public abstract
  341.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>
  342.             fundingTenorMarketParams (
  343.                 final org.drip.product.definition.Component comp,
  344.                 final boolean bBumpUp);

  345.     /**
  346.      * Get the map of tenor credit bumped Market Parameters corresponding to the component
  347.      *  
  348.      * @param comp Component
  349.      * @param bBumpUp Bump up (True)
  350.      *
  351.      * @return Map of the tenor credit bumped Market Parameters
  352.      */

  353.     public abstract
  354.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>
  355.             creditTenorMarketParams (
  356.                 final org.drip.product.definition.Component comp,
  357.                 final boolean bBumpUp);

  358.     /**
  359.      * Get the Market Parameters for the given basket product and the scenario
  360.      *
  361.      * @param bp BasketProduct
  362.      * @param strScenario Named Scenario
  363.      *
  364.      * @return Market Parameters Instance
  365.      */

  366.     public abstract org.drip.param.market.CurveSurfaceQuoteContainer scenarioMarketParams (
  367.         final org.drip.product.definition.BasketProduct bp,
  368.         final java.lang.String strScenario);

  369.     /**
  370.      * Get the Map of Funding Parallel Bumped Curves for the given Basket Product
  371.      *
  372.      * @param bp BasketProduct
  373.      * @param bBump True (Bump Up), False (Bump Down)
  374.      *
  375.      * @return Map of the Funding Parallel Bumped curves
  376.      */

  377.     public abstract
  378.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>
  379.             fundingFlatBump (
  380.                 final org.drip.product.definition.BasketProduct bp,
  381.                 final boolean bBump);

  382.     /**
  383.      * Get the Map of credit Flat Bumped Curves for the given Basket Product
  384.      *
  385.      * @param bp BasketProduct
  386.      * @param bBump True (Bump Up), False (Bump Down)
  387.      *
  388.      * @return Map of the Credit Flat Bumped Curves
  389.      */

  390.     public abstract
  391.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>
  392.             creditFlatBump (
  393.                 final org.drip.product.definition.BasketProduct bp,
  394.                 final boolean bBump);

  395.     /**
  396.      * Get the map of Recovery Flat Bumped Curves for the given Basket Product
  397.      *
  398.      * @param bp BasketProduct
  399.      * @param bBump True (Bump Up), False (Bump Down)
  400.      *
  401.      * @return Map of the Recovery Flat Bumped Curves
  402.      */

  403.     public abstract
  404.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>
  405.             recoveryFlatBump (
  406.                 final org.drip.product.definition.BasketProduct bp,
  407.                 final boolean bBump);

  408.     /**
  409.      * Get the Double Map of Funding Tenor Bumped Curves for each Funding Curve for the given Basket Product
  410.      *
  411.      * @param bp BasketProduct
  412.      * @param bBump True (Bump Up), False (Bump Down)
  413.      *
  414.      * @return Double Map of the Funding Tenor Bumped Market Parameters
  415.      */

  416.     public abstract
  417.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>>
  418.             fundingTenorBump (
  419.                 final org.drip.product.definition.BasketProduct bp,
  420.                 final boolean bBump);

  421.     /**
  422.      * Get the double map of credit Tenor bumped curves for each credit curve for the given Basket Product
  423.      *
  424.      * @param bp BasketProduct
  425.      * @param bBump True (Bump Up), False (Bump Down)
  426.      *
  427.      * @return Double Map of the credit Tenor bumped Market Parameters
  428.      */

  429.     public abstract
  430.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CurveSurfaceQuoteContainer>>
  431.             creditTenorBump (
  432.                 final org.drip.product.definition.BasketProduct bp,
  433.                 final boolean bBump);

  434.     /**
  435.      * Retrieve the Map of DiscountCurveScenarioContainer Instances
  436.      *
  437.      * @return Map of DiscountCurveScenarioContainer Instances
  438.      */

  439.     public abstract
  440.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.DiscountCurveScenarioContainer>
  441.             scenarioDiscountCurveMap();

  442.     /**
  443.      * Retrieve the Map of ScenarioCreditCurve Instances
  444.      *
  445.      * @return Map of ScenarioCreditCurve Instances
  446.      */

  447.     public abstract
  448.         org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.param.market.CreditCurveScenarioContainer>
  449.             scenarioCreditCurveMap();
  450. }