LocalControlCurveParams.java

  1.    
  2. package org.drip.state.estimator;

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

  6. /*!
  7.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  8.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  9.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  10.  * Copyright (C) 2017 Lakshmi Krishnamurthy
  11.  * Copyright (C) 2016 Lakshmi Krishnamurthy
  12.  * Copyright (C) 2015 Lakshmi Krishnamurthy
  13.  * Copyright (C) 2014 Lakshmi Krishnamurthy
  14.  * Copyright (C) 2013 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>LocalControlCurveParams</i> enhances the SmoothingCurveStretchParams to produce locally customized
  83.  * curve smoothing. Flags implemented by LocalControlCurveParams control the following:
  84.  *
  85.  *  <br><br>
  86.  *  <ul>
  87.  *      <li>
  88.  *          The C1 generator scheme to be used
  89.  *      </li>
  90.  *      <li>
  91.  *          Whether to eliminate spurious extrema
  92.  *      </li>
  93.  *      <li>
  94.  *          Whether or not to apply monotone filtering
  95.  *      </li>
  96.  *  </ul>
  97.  *
  98.  *  <br><br>
  99.  *  <ul>
  100.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  101.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  102.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/state/README.md">Latent State Inference and Creation Utilities</a></li>
  103.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/state/estimator/README.md">Multi-Pass Customized Stretch Curve</a></li>
  104.  *  </ul>
  105.  * <br><br>
  106.  *
  107.  * @author Lakshmi Krishnamurthy
  108.  */

  109. public class LocalControlCurveParams extends org.drip.state.estimator.SmoothingCurveStretchParams {
  110.     private boolean _bApplyMonotoneFilter = false;
  111.     private boolean _bEliminateSpuriousExtrema = false;
  112.     private java.lang.String _strC1GeneratorScheme = "";

  113.     /**
  114.      * LocalControlCurveParams constructor
  115.      *
  116.      * @param strC1GeneratorScheme C1 Generator Stretch
  117.      * @param strSmootheningQuantificationMetric Curve Smoothening Quantification Metric
  118.      * @param scbc Segment Builder Parameters
  119.      * @param iCalibrationDetail The Calibration Detail
  120.      * @param sbfr Curve Fitness Weighted Response
  121.      * @param sbfrSensitivity Curve Fitness Weighted Response Sensitivity
  122.      * @param bEliminateSpuriousExtrema TRUE - Eliminate Spurious Extrema
  123.      * @param bApplyMonotoneFilter TRUE - Apply Monotone Filter
  124.      *
  125.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  126.      */

  127.     public LocalControlCurveParams (
  128.         final java.lang.String strC1GeneratorScheme,
  129.         final java.lang.String strSmootheningQuantificationMetric,
  130.         final org.drip.spline.params.SegmentCustomBuilderControl scbc,
  131.         final int iCalibrationDetail,
  132.         final org.drip.spline.params.StretchBestFitResponse sbfr,
  133.         final org.drip.spline.params.StretchBestFitResponse sbfrSensitivity,
  134.         final boolean bEliminateSpuriousExtrema,
  135.         final boolean bApplyMonotoneFilter)
  136.         throws java.lang.Exception
  137.     {
  138.         super (strSmootheningQuantificationMetric, scbc, iCalibrationDetail, sbfr, sbfrSensitivity);

  139.         if (null == (_strC1GeneratorScheme = strC1GeneratorScheme))
  140.             throw new java.lang.Exception ("LocalControlCurveParams ctr: Invalid Inputs!");

  141.         _bApplyMonotoneFilter = bApplyMonotoneFilter;
  142.         _bEliminateSpuriousExtrema = bEliminateSpuriousExtrema;
  143.     }

  144.     /**
  145.      * Retrieve the Apply Monotone Filter Flag
  146.      *
  147.      * @return The Apply Monotone Filter Flag
  148.      */

  149.     public boolean applyMonotoneFilter()
  150.     {
  151.         return _bApplyMonotoneFilter;
  152.     }

  153.     /**
  154.      * Retrieve the Eliminate Spurious Extrema Flag
  155.      *
  156.      * @return The Eliminate Spurious Extrema Flag
  157.      */

  158.     public boolean eliminateSpuriousExtrema()
  159.     {
  160.         return _bEliminateSpuriousExtrema;
  161.     }

  162.     /**
  163.      * Retrieve the C1 Generator Scheme
  164.      *
  165.      * @return The C1 Generator Scheme
  166.      */

  167.     public java.lang.String C1GeneratorScheme()
  168.     {
  169.         return _strC1GeneratorScheme;
  170.     }
  171. }