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

  82. /**
  83.  * <i>CreditManifestMeasureTweak</i> contains the place holder for the credit curve scenario tweak
  84.  * parameters: in addition to the ResponseValueTweakParams fields, this exposes the calibration manifest
  85.  * measure, the curve node, and the nodal calibration type (entire curve/flat or a given tenor point).
  86.  *
  87.  *  <br><br>
  88.  *  <ul>
  89.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  90.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  91.  *      <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>
  92.  *      <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>
  93.  *  </ul>
  94.  *
  95.  * @author Lakshmi Krishnamurthy
  96.  */

  97. public class CreditManifestMeasureTweak extends ManifestMeasureTweak {

  98.     /**
  99.      * Tweak Parameter Type of Quote
  100.      */

  101.     public static final java.lang.String CREDIT_TWEAK_NODE_PARAM_QUOTE = "Quote";

  102.     /**
  103.      * Tweak Parameter Type of Recovery
  104.      */

  105.     public static final java.lang.String CREDIT_TWEAK_NODE_PARAM_RECOVERY = "Recovery";

  106.     /**
  107.      * Tweak Measure Type of Quote
  108.      */

  109.     public static final java.lang.String CREDIT_TWEAK_NODE_MEASURE_QUOTE = "Quote";

  110.     /**
  111.      * Tweak Measure Type of Hazard
  112.      */

  113.     public static final java.lang.String CREDIT_TWEAK_NODE_MEASURE_HAZARD = "Hazard";

  114.     private boolean _bSingleNodeCalib = false;
  115.     private java.lang.String _strParamType = "";
  116.     private java.lang.String _strMeasureType = "";

  117.     /**
  118.      * CreditManifestMeasureTweak constructor
  119.      *
  120.      * @param strParamType Node Tweak Parameter Type
  121.      * @param strMeasureType Node Tweak Measure Type
  122.      * @param iNode Node to be tweaked - Set to NODE_FLAT_TWEAK for flat curve tweak
  123.      * @param bIsProportional True - Tweak is proportional, False - parallel
  124.      * @param dblAmount Amount to be tweaked - proportional tweaks are represented as percent, parallel
  125.      *          tweaks are absolute numbers
  126.      * @param bSingleNodeCalib Flat Calibration using a single node?
  127.      *
  128.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  129.      */

  130.     public CreditManifestMeasureTweak (
  131.         final java.lang.String strParamType,
  132.         final java.lang.String strMeasureType,
  133.         final int iNode,
  134.         final boolean bIsProportional,
  135.         final double dblAmount,
  136.         final boolean bSingleNodeCalib)
  137.         throws java.lang.Exception
  138.     {
  139.         super (iNode, bIsProportional, dblAmount);

  140.         if (null == (_strParamType = strParamType))
  141.             throw new java.lang.Exception
  142.                 ("CreditManifestMeasureTweak ctr => Invalid Tweak Parameter Type!");

  143.         if (null == (_strMeasureType = strMeasureType))
  144.             throw new java.lang.Exception ("CreditManifestMeasureTweak ctr => Invalid Tweak Measure Type!");

  145.         _bSingleNodeCalib = bSingleNodeCalib;
  146.     }

  147.     /**
  148.      * Single Node Calibration Flag
  149.      *
  150.      * @return TRUE - Turn on Single Node Calibration
  151.      */

  152.     public boolean singleNodeCalib()
  153.     {
  154.         return _bSingleNodeCalib;
  155.     }

  156.     /**
  157.      * Retrieve the Tweak Parameter Type
  158.      *
  159.      * @return The Tweak Parameter Type
  160.      */

  161.     public java.lang.String paramType()
  162.     {
  163.         return _strParamType;
  164.     }

  165.     /**
  166.      * Retrieve the Tweak Measure Type
  167.      *
  168.      * @return The Tweak Measure Type
  169.      */

  170.     public java.lang.String measureType()
  171.     {
  172.         return _strMeasureType;
  173.     }
  174. }