ForwardHazardCreditCurve.java

  1. package org.drip.state.nonlinear;

  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>ForwardHazardCreditCurve</i> manages the Survival Latent State, using the Hazard Rate as the State
  84.  * Response Representation. It exports the following functionality:
  85.  *
  86.  *  <br><br>
  87.  *  <ul>
  88.  *      <li>
  89.  *          Boot Methods - Set/Bump Specific Node Quantification Metric, or Set Flat Value
  90.  *      </li>
  91.  *      <li>
  92.  *          Boot Calibration - Initialize Run, Compute Calibration Metric
  93.  *      </li>
  94.  *      <li>
  95.  *          Compute the survival probability, recovery rate, or the hazard rate from the Hazard Rate Latent
  96.  *              State
  97.  *      </li>
  98.  *      <li>
  99.  *          Retrieve Array of the Calibration Components
  100.  *      </li>
  101.  *      <li>
  102.  *          Retrieve the Curve Construction Input Set
  103.  *      </li>
  104.  *      <li>
  105.  *          Synthesize scenario Latent State by parallel shifting/custom tweaking the quantification metric
  106.  *      </li>
  107.  *      <li>
  108.  *          Synthesize scenario Latent State by parallel/custom shifting/custom tweaking the manifest measure
  109.  *      </li>
  110.  *  </ul>
  111.  *
  112.  *  <br><br>
  113.  *  <ul>
  114.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  115.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  116.  *      <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>
  117.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/state/nonlinear/README.md">Nonlinear (i.e., Boot) Latent State Construction</a></li>
  118.  *  </ul>
  119.  * <br><br>
  120.  *
  121.  * @author Lakshmi Krishnamurthy
  122.  */

  123. public class ForwardHazardCreditCurve extends org.drip.state.credit.ExplicitBootCreditCurve {
  124.     private int[] _aiHazardDate = null;
  125.     private int[] _aiRecoveryDate = null;
  126.     private double[] _adblHazardRate = null;
  127.     private double[] _adblRecoveryRate = null;

  128.     private org.drip.state.credit.CreditCurve createFromBaseMMTP (
  129.         final org.drip.param.definition.ManifestMeasureTweak mmtp)
  130.     {
  131.         double[] adblHazardBumped = org.drip.analytics.support.Helper.TweakManifestMeasure
  132.             (_adblHazardRate, mmtp);

  133.         if (null == adblHazardBumped || _adblHazardRate.length != adblHazardBumped.length) return null;

  134.         try {
  135.             return new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency, adblHazardBumped,
  136.                 _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate, _iSpecificDefaultDate);
  137.         } catch (java.lang.Exception e) {
  138.             e.printStackTrace();
  139.         }

  140.         return null;
  141.     }

  142.     /**
  143.      * Create a credit curve from hazard rate and recovery rate term structures
  144.      *
  145.      * @param iStartDate Curve Epoch date
  146.      * @param label Credit Curve Label
  147.      * @param strCurrency Currency
  148.      * @param adblHazardRate Matched array of hazard rates
  149.      * @param aiHazardDate Matched array of hazard dates
  150.      * @param adblRecoveryRate Matched array of recovery rates
  151.      * @param aiRecoveryDate Matched array of recovery dates
  152.      * @param iSpecificDefaultDate (Optional) Specific Default Date
  153.      *
  154.      * @throws java.lang.Exception Thrown if inputs are invalid
  155.      */

  156.     public ForwardHazardCreditCurve (
  157.         final int iStartDate,
  158.         final org.drip.state.identifier.EntityCDSLabel label,
  159.         final java.lang.String strCurrency,
  160.         final double adblHazardRate[],
  161.         final int aiHazardDate[],
  162.         final double[] adblRecoveryRate,
  163.         final int[] aiRecoveryDate,
  164.         final int iSpecificDefaultDate)
  165.         throws java.lang.Exception
  166.     {
  167.         super (iStartDate, label, strCurrency);

  168.         if (null == adblHazardRate || 0 == adblHazardRate.length || null == aiHazardDate || 0 ==
  169.             aiHazardDate.length || adblHazardRate.length != aiHazardDate.length || null ==
  170.                 adblRecoveryRate || 0 == adblRecoveryRate.length || null == aiRecoveryDate || 0 ==
  171.                     aiRecoveryDate.length || adblRecoveryRate.length != aiRecoveryDate.length)
  172.             throw new java.lang.Exception ("ForwardHazardCreditCurve ctr: Invalid Params!");

  173.         _iSpecificDefaultDate = iSpecificDefaultDate;
  174.         _adblHazardRate = new double[adblHazardRate.length];
  175.         _adblRecoveryRate = new double[adblRecoveryRate.length];
  176.         _aiHazardDate = new int[aiHazardDate.length];
  177.         _aiRecoveryDate = new int[aiRecoveryDate.length];

  178.         for (int i = 0; i < adblHazardRate.length; ++i)
  179.             _adblHazardRate[i] = adblHazardRate[i];

  180.         for (int i = 0; i < _aiHazardDate.length; ++i)
  181.             _aiHazardDate[i] = aiHazardDate[i];

  182.         for (int i = 0; i < adblRecoveryRate.length; ++i)
  183.             _adblRecoveryRate[i] = adblRecoveryRate[i];

  184.         for (int i = 0; i < aiRecoveryDate.length; ++i)
  185.             _aiRecoveryDate[i] = aiRecoveryDate[i];
  186.     }

  187.     @Override public double survival (
  188.         final int iDate)
  189.         throws java.lang.Exception
  190.     {
  191.         if (iDate <= _iEpochDate) return 1.;

  192.         if (java.lang.Integer.MIN_VALUE != _iSpecificDefaultDate && iDate >= _iSpecificDefaultDate)
  193.             return 0.;

  194.         int i = 0;
  195.         double dblExpArg = 0.;
  196.         int iStartDate = _iEpochDate;

  197.         while (i < _adblHazardRate.length && iDate > _aiHazardDate[i]) {
  198.             dblExpArg -= _adblHazardRate[i] * (_aiHazardDate[i] - iStartDate);
  199.             iStartDate = _aiHazardDate[i++];
  200.         }

  201.         if (i >= _adblHazardRate.length) i = _adblHazardRate.length - 1;

  202.         dblExpArg -= _adblHazardRate[i] * (iDate - iStartDate);

  203.         return java.lang.Math.exp (dblExpArg / 365.25);
  204.     }

  205.     @Override public double recovery (
  206.         final int iDate)
  207.         throws java.lang.Exception
  208.     {
  209.         for (int i = 0; i < _aiRecoveryDate.length; ++i) {
  210.             if (iDate < _aiRecoveryDate[i]) return _adblRecoveryRate[i];
  211.         }

  212.         return _adblRecoveryRate[_aiRecoveryDate.length - 1];
  213.     }

  214.     @Override public ForwardHazardCreditCurve parallelShiftQuantificationMetric (
  215.         final double dblShift)
  216.     {
  217.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblShift)) return null;

  218.         double[] adblHazard = new double[_adblHazardRate.length];

  219.         for (int i = 0; i < _adblHazardRate.length; ++i)
  220.             adblHazard[i] = _adblHazardRate[i] + dblShift;

  221.         try {
  222.             return new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency, adblHazard,
  223.                 _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate, _iSpecificDefaultDate);
  224.         } catch (java.lang.Exception e) {
  225.             e.printStackTrace();
  226.         }

  227.         return null;
  228.     }

  229.     @Override public org.drip.analytics.definition.Curve customTweakQuantificationMetric (
  230.         final org.drip.param.definition.ManifestMeasureTweak rvtp)
  231.     {
  232.         return null;
  233.     }

  234.     @Override public ForwardHazardCreditCurve parallelShiftManifestMeasure (
  235.         final java.lang.String strManifestMeasure,
  236.         final double dblShift)
  237.     {
  238.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblShift)) return null;

  239.         if (null == _valParam || null == _aCalibInst || 0 == _aCalibInst.length || null == _adblCalibQuote ||
  240.             0 == _adblCalibQuote.length || null == _astrCalibMeasure || 0 == _astrCalibMeasure.length ||
  241.                 _astrCalibMeasure.length != _adblCalibQuote.length || _adblCalibQuote.length !=
  242.                     _aCalibInst.length)
  243.             return parallelShiftQuantificationMetric (dblShift);

  244.         ForwardHazardCreditCurve cc = null;
  245.         double[] adblCalibQuote = new double[_adblCalibQuote.length];

  246.         try {
  247.             cc = new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency, _adblHazardRate,
  248.                 _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate, _iSpecificDefaultDate);
  249.         } catch (java.lang.Exception e) {
  250.             e.printStackTrace();

  251.             return null;
  252.         }

  253.         for (int i = 0; i < _adblCalibQuote.length; ++i) {
  254.             try {
  255.                 org.drip.state.nonlinear.NonlinearCurveBuilder.CreditCurve (_valParam, _aCalibInst[i],
  256.                     adblCalibQuote[i] = _adblCalibQuote[i] + dblShift, _astrCalibMeasure[i], _bFlat, i, cc,
  257.                         _dc, _gc, _pricerParam, _lsfc, _quotingParams, null);
  258.             } catch (java.lang.Exception e) {
  259.                 e.printStackTrace();

  260.                 return null;
  261.             }
  262.         }

  263.         cc.setInstrCalibInputs (_valParam, _bFlat, _dc, _gc, _pricerParam, _aCalibInst, adblCalibQuote,
  264.             _astrCalibMeasure, _lsfc, _quotingParams);

  265.         return cc;
  266.     }

  267.     @Override public ForwardHazardCreditCurve shiftManifestMeasure (
  268.         final int iSpanIndex,
  269.         final java.lang.String strManifestMeasure,
  270.         final double dblShift)
  271.     {
  272.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblShift)) return null;

  273.         if (null == _valParam || null == _aCalibInst || 0 == _aCalibInst.length || null == _adblCalibQuote ||
  274.             0 == _adblCalibQuote.length || null == _astrCalibMeasure || 0 == _astrCalibMeasure.length ||
  275.                 _astrCalibMeasure.length != _adblCalibQuote.length || _adblCalibQuote.length !=
  276.                     _aCalibInst.length)
  277.             return parallelShiftQuantificationMetric (dblShift);

  278.         ForwardHazardCreditCurve cc = null;
  279.         double[] adblCalibQuote = new double[_adblCalibQuote.length];

  280.         if (iSpanIndex >= _adblCalibQuote.length) return null;

  281.         try {
  282.             cc = new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency, _adblHazardRate,
  283.                 _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate, _iSpecificDefaultDate);
  284.         } catch (java.lang.Exception e) {
  285.             e.printStackTrace();

  286.             return null;
  287.         }

  288.         for (int i = 0; i < _adblCalibQuote.length; ++i) {
  289.             try {
  290.                 org.drip.state.nonlinear.NonlinearCurveBuilder.CreditCurve (_valParam, _aCalibInst[i],
  291.                     adblCalibQuote[i] = _adblCalibQuote[i] + (i == iSpanIndex ? dblShift : 0.),
  292.                         _astrCalibMeasure[i], _bFlat, i, cc, _dc, _gc, _pricerParam, _lsfc,
  293.                             _quotingParams, null);
  294.             } catch (java.lang.Exception e) {
  295.                 e.printStackTrace();

  296.                 return null;
  297.             }
  298.         }

  299.         cc.setInstrCalibInputs (_valParam, _bFlat, _dc, _gc, _pricerParam, _aCalibInst, adblCalibQuote,
  300.             _astrCalibMeasure, _lsfc, _quotingParams);

  301.         return cc;
  302.     }

  303.     @Override public org.drip.state.credit.CreditCurve flatCurve (
  304.         final double dblFlatNodeValue,
  305.         final boolean bSingleNode,
  306.         final double dblRecovery)
  307.     {
  308.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblFlatNodeValue) || 0. >= dblFlatNodeValue || null ==
  309.             _valParam || null == _aCalibInst || 0 == _aCalibInst.length || null == _adblCalibQuote || 0 ==
  310.                 _adblCalibQuote.length || null == _astrCalibMeasure || 0 == _astrCalibMeasure.length ||
  311.                     _astrCalibMeasure.length != _adblCalibQuote.length || _adblCalibQuote.length !=
  312.                         _aCalibInst.length)
  313.             return null;

  314.         org.drip.state.credit.ExplicitBootCreditCurve cc = null;

  315.         try {
  316.             if (bSingleNode)
  317.                 cc = org.drip.state.creator.ScenarioCreditCurveBuilder.Hazard (_iEpochDate,
  318.                     _label.fullyQualifiedName(), _strCurrency, _adblHazardRate[0], _aiHazardDate[0],
  319.                         !org.drip.numerical.common.NumberUtil.IsValid (dblRecovery) ? _adblRecoveryRate[0] :
  320.                             dblRecovery);
  321.             else
  322.                 cc = new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency, _adblHazardRate,
  323.                     _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate, _iSpecificDefaultDate);
  324.         } catch (java.lang.Exception e) {
  325.             e.printStackTrace();

  326.             return null;
  327.         }

  328.         for (int i = 0; i < _adblCalibQuote.length; ++i) {
  329.             try {
  330.                 org.drip.state.nonlinear.NonlinearCurveBuilder.CreditCurve (_valParam, _aCalibInst[i],
  331.                     dblFlatNodeValue, _astrCalibMeasure[i], true, i, cc, _dc, _gc, _pricerParam, _lsfc,
  332.                         _quotingParams, null);
  333.             } catch (java.lang.Exception e) {
  334.                 e.printStackTrace();

  335.                 return null;
  336.             }
  337.         }

  338.         if (bSingleNode)
  339.             cc.setInstrCalibInputs (_valParam, true, _dc, _gc, _pricerParam, new
  340.                 org.drip.product.definition.CalibratableComponent[] {_aCalibInst[0]}, new double[]
  341.                     {dblFlatNodeValue}, _astrCalibMeasure, _lsfc, _quotingParams);
  342.         else {
  343.             double[] adblCalibValue = new double[_adblCalibQuote.length];

  344.             for (int i = 0; i < _adblCalibQuote.length; ++i)
  345.                 adblCalibValue[i] = dblFlatNodeValue;

  346.             cc.setInstrCalibInputs (_valParam, true, _dc, _gc, _pricerParam, _aCalibInst, adblCalibValue,
  347.                 _astrCalibMeasure, _lsfc, _quotingParams);
  348.         }

  349.         return cc;
  350.     }

  351.     @Override  public org.drip.state.credit.CreditCurve customTweakManifestMeasure (
  352.         final java.lang.String strManifestMeasure,
  353.         final org.drip.param.definition.ManifestMeasureTweak mmtp)
  354.     {
  355.         if (null == mmtp) return null;

  356.         if (!(mmtp instanceof org.drip.param.definition.CreditManifestMeasureTweak))
  357.             return createFromBaseMMTP (mmtp);

  358.         org.drip.param.definition.CreditManifestMeasureTweak cmmt =
  359.             (org.drip.param.definition.CreditManifestMeasureTweak) mmtp;

  360.         if (org.drip.param.definition.CreditManifestMeasureTweak.CREDIT_TWEAK_NODE_PARAM_RECOVERY.equalsIgnoreCase
  361.             (cmmt.paramType())) {
  362.             double[] adblRecoveryRateBumped = null;

  363.             if (null == (adblRecoveryRateBumped =
  364.                 org.drip.analytics.support.Helper.TweakManifestMeasure (_adblRecoveryRate, cmmt)) ||
  365.                     adblRecoveryRateBumped.length != _adblRecoveryRate.length)
  366.                 return null;

  367.             try {
  368.                 return new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency, _adblHazardRate,
  369.                     _aiHazardDate, adblRecoveryRateBumped, _aiRecoveryDate, _iSpecificDefaultDate);
  370.             } catch (java.lang.Exception e) {
  371.                 e.printStackTrace();
  372.             }
  373.         } else if
  374.             (org.drip.param.definition.CreditManifestMeasureTweak.CREDIT_TWEAK_NODE_PARAM_QUOTE.equalsIgnoreCase
  375.                 (cmmt.paramType())) {
  376.             if (org.drip.param.definition.CreditManifestMeasureTweak.CREDIT_TWEAK_NODE_MEASURE_HAZARD.equalsIgnoreCase
  377.                 (cmmt.measureType())) {
  378.                 double[] adblHazardBumped = null;

  379.                 if (null == (adblHazardBumped =
  380.                     org.drip.analytics.support.Helper.TweakManifestMeasure (_adblHazardRate, cmmt))
  381.                         || adblHazardBumped.length != _adblHazardRate.length)
  382.                     return null;

  383.                 try {
  384.                     return new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency,
  385.                         adblHazardBumped, _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate,
  386.                             _iSpecificDefaultDate);
  387.                 } catch (java.lang.Exception e) {
  388.                     e.printStackTrace();
  389.                 }
  390.             } else if
  391.                 (org.drip.param.definition.CreditManifestMeasureTweak.CREDIT_TWEAK_NODE_MEASURE_QUOTE.equalsIgnoreCase
  392.                     (cmmt.measureType())) {
  393.                 double[] adblQuoteBumped = null;

  394.                 if (null == (adblQuoteBumped =
  395.                     org.drip.analytics.support.Helper.TweakManifestMeasure (_adblHazardRate, cmmt))
  396.                         || adblQuoteBumped.length != _adblHazardRate.length)
  397.                     return null;

  398.                 org.drip.state.credit.ExplicitBootCreditCurve cc = null;

  399.                 try {
  400.                     if (cmmt.singleNodeCalib())
  401.                         cc = org.drip.state.creator.ScenarioCreditCurveBuilder.Hazard (_iEpochDate,
  402.                             _strCurrency, _label.fullyQualifiedName(), _adblHazardRate[0],
  403.                                 _aiHazardDate[0], _adblRecoveryRate[0]);
  404.                     else
  405.                         cc = new ForwardHazardCreditCurve (_iEpochDate, _label, _strCurrency,
  406.                             _adblHazardRate, _aiHazardDate, _adblRecoveryRate, _aiRecoveryDate,
  407.                                 _iSpecificDefaultDate);
  408.                 } catch (java.lang.Exception e) {
  409.                     e.printStackTrace();

  410.                     return null;
  411.                 }

  412.                 for (int i = 0; i < adblQuoteBumped.length; ++i) {
  413.                     try {
  414.                         org.drip.state.nonlinear.NonlinearCurveBuilder.CreditCurve (_valParam,
  415.                             _aCalibInst[i], adblQuoteBumped[i], _astrCalibMeasure[i], _bFlat, i, cc, _dc,
  416.                                 _gc, _pricerParam, _lsfc, _quotingParams, null);
  417.                     } catch (java.lang.Exception e) {
  418.                         e.printStackTrace();

  419.                         return null;
  420.                     }
  421.                 }

  422.                 cc.setInstrCalibInputs (_valParam, _bFlat, _dc, _gc, _pricerParam, _aCalibInst,
  423.                     adblQuoteBumped, _astrCalibMeasure, _lsfc, _quotingParams);

  424.                 return cc;
  425.             }
  426.         }

  427.         return null;
  428.     }

  429.     @Override public boolean setNodeValue (
  430.         final int iNodeIndex,
  431.         final double dblValue)
  432.     {
  433.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblValue) || iNodeIndex > _adblHazardRate.length)
  434.             return false;

  435.         for (int i = iNodeIndex; i < _adblHazardRate.length; ++i)
  436.             _adblHazardRate[i] = dblValue;

  437.         return true;
  438.     }

  439.     @Override public boolean bumpNodeValue (
  440.         final int iNodeIndex,
  441.         final double dblValue)
  442.     {
  443.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblValue) || iNodeIndex > _adblHazardRate.length)
  444.             return false;

  445.         for (int i = iNodeIndex; i < _adblHazardRate.length; ++i)
  446.             _adblHazardRate[i] += dblValue;

  447.         return true;
  448.     }

  449.     @Override public boolean setFlatValue (
  450.         final double dblValue)
  451.     {
  452.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblValue)) return false;

  453.         for (int i = 0; i < _adblHazardRate.length; ++i)
  454.             _adblHazardRate[i] = dblValue;

  455.         return true;
  456.     }
  457. }