CDSEuropeanOption.java

  1. package org.drip.product.option;

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

  79. /**
  80.  * <i>CDSEuropeanOption</i> implements the Payer/Receiver European Option on a CDS.
  81.  *
  82.  * <br><br>
  83.  *  <ul>
  84.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  85.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  86.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/product/README.md">Product Components/Baskets for Credit, FRA, FX, Govvie, Rates, and Option AssetClasses</a></li>
  87.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/product/option/README.md">Options on Fixed Income Components</a></li>
  88.  *  </ul>
  89.  * <br><br>
  90.  *
  91.  * @author Lakshmi Krishnamurthy
  92.  */

  93. public class CDSEuropeanOption extends org.drip.product.option.OptionComponent {
  94.     private boolean _bIsReceiver = false;
  95.     private org.drip.pricer.option.FokkerPlanckGenerator _fpg = null;
  96.     private org.drip.product.definition.CreditDefaultSwap _cds = null;

  97.     /**
  98.      * CDSEuropeanOption constructor
  99.      *
  100.      * @param strName Name
  101.      * @param cds The Underlying CDS Component
  102.      * @param strManifestMeasure Measure of the Underlying Component
  103.      * @param bIsReceiver Is the Option a Receiver/Payer? TRUE - Receiver
  104.      * @param dblStrike Strike of the Underlying Component's Measure
  105.      * @param ltds Last Trading Date Setting
  106.      * @param fpg The Fokker Planck Pricer Instance
  107.      * @param csp Cash Settle Parameters
  108.      *
  109.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  110.      */

  111.     public CDSEuropeanOption (
  112.         final java.lang.String strName,
  113.         final org.drip.product.definition.CreditDefaultSwap cds,
  114.         final java.lang.String strManifestMeasure,
  115.         final boolean bIsReceiver,
  116.         final double dblStrike,
  117.         final org.drip.product.params.LastTradingDateSetting ltds,
  118.         final org.drip.pricer.option.FokkerPlanckGenerator fpg,
  119.         final org.drip.param.valuation.CashSettleParams csp)
  120.         throws java.lang.Exception
  121.     {
  122.         super (strName, cds, strManifestMeasure, dblStrike, cds.initialNotional(), ltds, csp);

  123.         if (null == (_fpg = fpg))
  124.             throw new java.lang.Exception ("CDSEuropeanOption ctr: Invalid Option Pricer");

  125.         _cds = cds;
  126.         _bIsReceiver = bIsReceiver;
  127.     }

  128.     /**
  129.      * Generate the Standard CDS European Option Measures from the Integrated Surface Variance
  130.      *
  131.      * @param valParams The Valuation Parameters
  132.      * @param pricerParams The Pricer Parameters
  133.      * @param csqc The Market Parameters
  134.      * @param vcp The Valuation Customization Parameters
  135.      * @param dblIntegratedSurfaceVariance The Integrated Surface Variance
  136.      *
  137.      * @return The Standard CDS European Option Measures
  138.      */

  139.     public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> valueFromSurfaceVariance (
  140.         final org.drip.param.valuation.ValuationParams valParams,
  141.         final org.drip.param.pricer.CreditPricerParams pricerParams,
  142.         final org.drip.param.market.CurveSurfaceQuoteContainer csqc,
  143.         final org.drip.param.valuation.ValuationCustomizationParams vcp,
  144.         final double dblIntegratedSurfaceVariance)
  145.     {
  146.         if (null == valParams) return null;

  147.         int iValueDate = valParams.valueDate();

  148.         org.drip.product.params.LastTradingDateSetting ltds = lastTradingDateSetting();

  149.         try {
  150.             if (null != ltds && iValueDate >= ltds.lastTradingDate (_cds.effectiveDate().julian(),
  151.                 _cds.payCurrency()))
  152.                 return null;
  153.         } catch (java.lang.Exception e) {
  154.             e.printStackTrace();

  155.             return null;
  156.         }

  157.         long lStart = System.nanoTime();

  158.         int iExerciseDate = exerciseDate().julian();

  159.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapCDSOutput = _cds.value
  160.             (valParams, pricerParams, csqc, vcp);

  161.         java.lang.String strManifestMeasure = manifestMeasure();

  162.         if (null == mapCDSOutput || !mapCDSOutput.containsKey ("DV01") || !mapCDSOutput.containsKey
  163.             (strManifestMeasure))
  164.             return null;

  165.         double dblCDSDV01 = mapCDSOutput.get ("DV01");

  166.         double dblATMManifestMeasure = mapCDSOutput.get (strManifestMeasure);

  167.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblATMManifestMeasure) ||
  168.             !org.drip.numerical.common.NumberUtil.IsValid (dblCDSDV01))
  169.             return null;

  170.         org.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqc.fundingState
  171.             (_cds.fundingLabel());

  172.         try {
  173.             double dblStrike = strike();

  174.             double dblNotional = notional();

  175.             double dblMoneynessFactor = dblATMManifestMeasure / dblStrike;
  176.             double dblManifestMeasurePriceTransformer = java.lang.Double.NaN;
  177.             double dblManifestMeasureIntrinsic = _bIsReceiver ? dblATMManifestMeasure - dblStrike : dblStrike
  178.                 - dblATMManifestMeasure;

  179.             if (strManifestMeasure.equalsIgnoreCase ("Price") || strManifestMeasure.equalsIgnoreCase ("PV"))
  180.                 dblManifestMeasurePriceTransformer = dcFunding.df (iExerciseDate);
  181.             else if (strManifestMeasure.equalsIgnoreCase ("FairPremium") ||
  182.                 strManifestMeasure.equalsIgnoreCase ("ParSpread") || strManifestMeasure.equalsIgnoreCase
  183.                     ("QuantoAdjustedParSpread"))
  184.                 dblManifestMeasurePriceTransformer = dblCDSDV01;

  185.             if (!org.drip.numerical.common.NumberUtil.IsValid (dblManifestMeasurePriceTransformer)) return null;

  186.             double dblTTE = (iExerciseDate - iValueDate) / 365.25;

  187.             org.drip.pricer.option.Greeks optGreek = _fpg.greeks (dblStrike, dblTTE, -(java.lang.Math.log
  188.                 (dcFunding.df (iExerciseDate))) / dblTTE, dblATMManifestMeasure, _bIsReceiver, true,
  189.                     java.lang.Math.sqrt (dblIntegratedSurfaceVariance / dblTTE));

  190.             org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult = new
  191.                 org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>();

  192.             double dblForwardIntrinsic = optGreek.expectedPayoff();

  193.             double dblForwardATMIntrinsic = optGreek.expectedATMPayoff();

  194.             double dblSpotPrice = dblForwardIntrinsic * dblManifestMeasurePriceTransformer;

  195.             double dblFPGCharm = optGreek.charm();

  196.             double dblFPGColor = optGreek.color();

  197.             double dblFPGDelta = optGreek.delta();

  198.             double dblFPGGamma = optGreek.gamma();

  199.             double dblFPGRho = optGreek.rho();

  200.             double dblFPGSpeed = optGreek.speed();

  201.             double dblFPGTheta = optGreek.theta();

  202.             double dblFPGUltima = optGreek.ultima();

  203.             double dblFPGVanna = optGreek.vanna();

  204.             double dblFPGVega = optGreek.vega();

  205.             double dblFPGVeta = optGreek.veta();

  206.             double dblFPGVomma = optGreek.vomma();

  207.             mapResult.put ("ATMManifestMeasure", dblATMManifestMeasure);

  208.             mapResult.put ("ATMPrice", dblForwardATMIntrinsic * dblManifestMeasurePriceTransformer);

  209.             mapResult.put ("CalcTime", (System.nanoTime() - lStart) * 1.e-09);

  210.             mapResult.put ("Charm", dblFPGCharm * dblManifestMeasurePriceTransformer);

  211.             mapResult.put ("Color", dblFPGColor * dblManifestMeasurePriceTransformer);

  212.             mapResult.put ("Delta", dblFPGDelta * dblManifestMeasurePriceTransformer);

  213.             mapResult.put ("EffectiveVolatility", optGreek.effectiveVolatility());

  214.             mapResult.put ("ExpectedATMPayoff", optGreek.expectedATMPayoff());

  215.             mapResult.put ("ExpectedPayoff", optGreek.expectedPayoff());

  216.             mapResult.put ("ForwardATMIntrinsic", dblForwardATMIntrinsic);

  217.             mapResult.put ("ForwardIntrinsic", dblForwardIntrinsic);

  218.             mapResult.put ("FPGCharm", dblFPGCharm);

  219.             mapResult.put ("FPGColor", dblFPGColor);

  220.             mapResult.put ("FPGDelta", dblFPGDelta);

  221.             mapResult.put ("FPGGamma", dblFPGGamma);

  222.             mapResult.put ("FPGRho", dblFPGRho);

  223.             mapResult.put ("FPGSpeed", dblFPGSpeed);

  224.             mapResult.put ("FPGTheta", dblFPGTheta);

  225.             mapResult.put ("FPGUltima", dblFPGUltima);

  226.             mapResult.put ("FPGVanna", dblFPGVanna);

  227.             mapResult.put ("FPGVega", dblFPGVega);

  228.             mapResult.put ("FPGVeta", dblFPGVeta);

  229.             mapResult.put ("FPGVomma", dblFPGVomma);

  230.             mapResult.put ("Gamma", dblFPGGamma * dblManifestMeasurePriceTransformer);

  231.             mapResult.put ("IntegratedSurfaceVariance", dblIntegratedSurfaceVariance);

  232.             mapResult.put ("ManifestMeasureIntrinsic", dblManifestMeasureIntrinsic);

  233.             mapResult.put ("ManifestMeasureIntrinsicValue", dblManifestMeasureIntrinsic *
  234.                 dblManifestMeasurePriceTransformer);

  235.             mapResult.put ("ManifestMeasurePriceTransformer", dblManifestMeasurePriceTransformer);

  236.             mapResult.put ("MoneynessFactor", dblMoneynessFactor);

  237.             mapResult.put ("Price", dblSpotPrice);

  238.             mapResult.put ("Prob1", optGreek.prob1());

  239.             mapResult.put ("Prob2", optGreek.prob2());

  240.             mapResult.put ("PV", dblSpotPrice * dblNotional);

  241.             mapResult.put ("Rho", dblFPGRho * dblManifestMeasurePriceTransformer);

  242.             mapResult.put ("Speed", dblFPGSpeed * dblManifestMeasurePriceTransformer);

  243.             mapResult.put ("SpotPrice", dblSpotPrice);

  244.             mapResult.put ("Theta", dblFPGTheta * dblManifestMeasurePriceTransformer);

  245.             mapResult.put ("Ultima", optGreek.ultima() * dblManifestMeasurePriceTransformer);

  246.             mapResult.put ("Upfront", dblSpotPrice);

  247.             mapResult.put ("Vanna", optGreek.vanna() * dblManifestMeasurePriceTransformer);

  248.             mapResult.put ("Vega", dblFPGVega * dblManifestMeasurePriceTransformer);

  249.             mapResult.put ("Veta", optGreek.veta() * dblManifestMeasurePriceTransformer);

  250.             mapResult.put ("Vomma", optGreek.vomma() * dblManifestMeasurePriceTransformer);

  251.             return mapResult;
  252.         } catch (java.lang.Exception e) {
  253.             // e.printStackTrace();
  254.         }

  255.         return null;
  256.     }

  257.     @Override public java.util.Set<java.lang.String> measureNames()
  258.     {
  259.         java.util.Set<java.lang.String> setstrMeasureNames = new java.util.TreeSet<java.lang.String>();

  260.         setstrMeasureNames.add ("ATMManifestMeasure");

  261.         setstrMeasureNames.add ("ATMPrice");

  262.         setstrMeasureNames.add ("CalcTime");

  263.         setstrMeasureNames.add ("Charm");

  264.         setstrMeasureNames.add ("Color");

  265.         setstrMeasureNames.add ("Delta");

  266.         setstrMeasureNames.add ("EffectiveVolatility");

  267.         setstrMeasureNames.add ("ExpectedATMPayoff");

  268.         setstrMeasureNames.add ("ExpectedPayoff");

  269.         setstrMeasureNames.add ("ForwardATMIntrinsic");

  270.         setstrMeasureNames.add ("ForwardIntrinsic");

  271.         setstrMeasureNames.add ("FPGCharm");

  272.         setstrMeasureNames.add ("FPGColor");

  273.         setstrMeasureNames.add ("FPGDelta");

  274.         setstrMeasureNames.add ("FPGGamma");

  275.         setstrMeasureNames.add ("FPGRho");

  276.         setstrMeasureNames.add ("FPGSpeed");

  277.         setstrMeasureNames.add ("FPGTheta");

  278.         setstrMeasureNames.add ("FPGUltima");

  279.         setstrMeasureNames.add ("FPGVanna");

  280.         setstrMeasureNames.add ("FPGVega");

  281.         setstrMeasureNames.add ("FPGVeta");

  282.         setstrMeasureNames.add ("FPGVomma");

  283.         setstrMeasureNames.add ("Gamma");

  284.         setstrMeasureNames.add ("IntegratedSurfaceVariance");

  285.         setstrMeasureNames.add ("ManifestMeasureIntrinsic");

  286.         setstrMeasureNames.add ("ManifestMeasureIntrinsicValue");

  287.         setstrMeasureNames.add ("ManifestMeasurePriceTransformer");

  288.         setstrMeasureNames.add ("MoneynessFactor");

  289.         setstrMeasureNames.add ("Price");

  290.         setstrMeasureNames.add ("Prob1");

  291.         setstrMeasureNames.add ("Prob2");

  292.         setstrMeasureNames.add ("PV");

  293.         setstrMeasureNames.add ("Rho");

  294.         setstrMeasureNames.add ("Speed");

  295.         setstrMeasureNames.add ("SpotPrice");

  296.         setstrMeasureNames.add ("Theta");

  297.         setstrMeasureNames.add ("Ultima");

  298.         setstrMeasureNames.add ("Upfront");

  299.         setstrMeasureNames.add ("Vanna");

  300.         setstrMeasureNames.add ("Vega");

  301.         setstrMeasureNames.add ("Veta");

  302.         setstrMeasureNames.add ("Vomma");

  303.         return setstrMeasureNames;
  304.     }

  305.     @Override public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String> couponCurrency()
  306.     {
  307.         return _cds.couponCurrency();
  308.     }

  309.     @Override public java.lang.String payCurrency()
  310.     {
  311.         return _cds.payCurrency();
  312.     }

  313.     @Override public java.lang.String principalCurrency()
  314.     {
  315.         return _cds.principalCurrency();
  316.     }

  317.     @Override public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value (
  318.         final org.drip.param.valuation.ValuationParams valParams,
  319.         final org.drip.param.pricer.CreditPricerParams pricerParams,
  320.         final org.drip.param.market.CurveSurfaceQuoteContainer csqs,
  321.         final org.drip.param.valuation.ValuationCustomizationParams vcp)
  322.     {
  323.         if (null == valParams || null == csqs) return null;

  324.         try {
  325.             return valueFromSurfaceVariance (valParams, pricerParams, csqs, vcp,
  326.                 org.drip.analytics.support.OptionHelper.IntegratedSurfaceVariance (csqs.customVolatility
  327.                     (org.drip.state.identifier.CustomLabel.Standard (_cds.name() + "_" + manifestMeasure())),
  328.                         valParams.valueDate(), exerciseDate().julian()));
  329.         } catch (java.lang.Exception e) {
  330.             e.printStackTrace();
  331.         }

  332.         return null;
  333.     }

  334.     @Override public double pv (
  335.         final org.drip.param.valuation.ValuationParams valParams,
  336.         final org.drip.param.pricer.CreditPricerParams pricerParams,
  337.         final org.drip.param.market.CurveSurfaceQuoteContainer csqs,
  338.         final org.drip.param.valuation.ValuationCustomizationParams quotingParams)
  339.         throws java.lang.Exception
  340.     {
  341.         if (null == valParams) throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  342.         int iValueDate = valParams.valueDate();

  343.         int iExerciseDate = exerciseDate().julian();

  344.         org.drip.product.params.LastTradingDateSetting ltds = lastTradingDateSetting();

  345.         java.lang.String strPayCurrency = payCurrency();

  346.         if (null != ltds && iValueDate >= ltds.lastTradingDate (_cds.effectiveDate().julian(),
  347.             strPayCurrency))
  348.             throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");;

  349.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapCDSOutput = _cds.value
  350.             (valParams, pricerParams, csqs, quotingParams);

  351.         java.lang.String strManifestMeasure = manifestMeasure();

  352.         if (null == mapCDSOutput || !mapCDSOutput.containsKey (strManifestMeasure))
  353.             throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  354.         double dblFixedCleanDV01 = mapCDSOutput.get ("CleanDV01");

  355.         double dblATMManifestMeasure = mapCDSOutput.get (strManifestMeasure);

  356.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblATMManifestMeasure))
  357.             throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  358.         double dblIntegratedSurfaceVariance =
  359.             org.drip.analytics.support.OptionHelper.IntegratedSurfaceVariance (csqs.customVolatility
  360.                 (org.drip.state.identifier.CustomLabel.Standard (_cds.name() + "_" + strManifestMeasure)),
  361.                     iValueDate, iExerciseDate);

  362.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblIntegratedSurfaceVariance))
  363.             throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  364.         double dblIntegratedSurfaceVolatility = java.lang.Math.sqrt (dblIntegratedSurfaceVariance);

  365.         double dblStrike = strike();

  366.         double dblMoneynessFactor = dblATMManifestMeasure / dblStrike;

  367.         double dblLogMoneynessFactor = java.lang.Math.log (dblMoneynessFactor);

  368.         double dblForwardIntrinsic = java.lang.Double.NaN;
  369.         double dblManifestMeasurePriceTransformer = java.lang.Double.NaN;
  370.         double dblDPlus = (dblLogMoneynessFactor + 0.5 * dblIntegratedSurfaceVariance) /
  371.             dblIntegratedSurfaceVolatility;
  372.         double dblDMinus = (dblLogMoneynessFactor - 0.5 * dblIntegratedSurfaceVariance) /
  373.             dblIntegratedSurfaceVolatility;

  374.         org.drip.state.discount.MergedDiscountForwardCurve dcFunding = csqs.fundingState
  375.             (org.drip.state.identifier.FundingLabel.Standard (strPayCurrency));

  376.         if (null == dcFunding) throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  377.         org.drip.state.credit.CreditCurve cc = csqs.creditState (_cds.creditLabel());

  378.         if (null == cc) throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  379.         if (strManifestMeasure.equalsIgnoreCase ("Price") || strManifestMeasure.equalsIgnoreCase ("PV"))
  380.             dblManifestMeasurePriceTransformer = dcFunding.df (iExerciseDate) * cc.survival (iExerciseDate);
  381.         else if (strManifestMeasure.equalsIgnoreCase ("FairPremium") || strManifestMeasure.equalsIgnoreCase
  382.             ("ParSpread") || strManifestMeasure.equalsIgnoreCase ("Rate"))
  383.             dblManifestMeasurePriceTransformer = dblFixedCleanDV01;

  384.         if (!org.drip.numerical.common.NumberUtil.IsValid (dblManifestMeasurePriceTransformer))
  385.             throw new java.lang.Exception ("CDSEuropeanOption::pv => Invalid Inputs");

  386.         if (_bIsReceiver)
  387.             dblForwardIntrinsic = dblATMManifestMeasure * org.drip.measure.gaussian.NormalQuadrature.CDF (dblDPlus)
  388.                 - dblStrike * org.drip.measure.gaussian.NormalQuadrature.CDF (dblDMinus);
  389.         else
  390.             dblForwardIntrinsic = dblStrike * org.drip.measure.gaussian.NormalQuadrature.CDF (-dblDMinus) -
  391.                 dblATMManifestMeasure * org.drip.measure.gaussian.NormalQuadrature.CDF (-dblDPlus);

  392.         return dblForwardIntrinsic * dblManifestMeasurePriceTransformer;
  393.     }

  394.     @Override public org.drip.product.calib.ProductQuoteSet calibQuoteSet (
  395.         final org.drip.state.representation.LatentStateSpecification[] aLSS)
  396.     {
  397.         try {
  398.             return new org.drip.product.calib.ProductQuoteSet (aLSS);
  399.         } catch (java.lang.Exception e) {
  400.             e.printStackTrace();
  401.         }

  402.         return null;
  403.     }

  404.     @Override public org.drip.state.estimator.PredictorResponseWeightConstraint volatilityPRWC (
  405.         final org.drip.param.valuation.ValuationParams valParams,
  406.         final org.drip.param.pricer.CreditPricerParams pricerParams,
  407.         final org.drip.param.market.CurveSurfaceQuoteContainer csqs,
  408.         final org.drip.param.valuation.ValuationCustomizationParams quotingParams,
  409.         final org.drip.product.calib.ProductQuoteSet pqs)
  410.     {
  411.         return null;
  412.     }
  413. }