ComponentPair.java

  1. package org.drip.product.fx;

  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>ComponentPair</i> contains the implementation of the dual cross currency components. It is composed of
  81.  * two different Rates Components - one each for each currency.
  82.  *
  83.  * <br><br>
  84.  *  <ul>
  85.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  86.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  87.  *      <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>
  88.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/product/fx/README.md">FX Forwards, Cross Currency Swaps</a></li>
  89.  *  </ul>
  90.  * <br><br>
  91.  *
  92.  * @author Lakshmi Krishnamurthy
  93.  */

  94. public class ComponentPair extends org.drip.product.definition.BasketProduct {
  95.     private java.lang.String _strName = "";
  96.     private org.drip.param.period.FixingSetting _fxFixingSetting = null;
  97.     private org.drip.product.definition.CalibratableComponent _rcDerived = null;
  98.     private org.drip.product.definition.CalibratableComponent _rcReference = null;

  99.     /**
  100.      * ComponentPair constructor
  101.      *
  102.      * @param strName The ComponentPair Instance Name
  103.      * @param rcReference The Reference Component
  104.      * @param rcDerived The Derived Component
  105.      * @param fxFixingSetting FX Fixing Setting
  106.      *
  107.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  108.      */

  109.     public ComponentPair (
  110.         final java.lang.String strName,
  111.         final org.drip.product.definition.CalibratableComponent rcReference,
  112.         final org.drip.product.definition.CalibratableComponent rcDerived,
  113.         final org.drip.param.period.FixingSetting fxFixingSetting)
  114.         throws java.lang.Exception
  115.     {
  116.         if (null == (_strName = strName) || _strName.isEmpty() || null == (_rcDerived = rcDerived) || null ==
  117.             (_rcReference = rcReference))
  118.             throw new java.lang.Exception ("ComponentPair ctr: Invalid Inputs!");

  119.         _fxFixingSetting = fxFixingSetting;
  120.     }

  121.     /**
  122.      * Retrieve the Reference Component
  123.      *
  124.      * @return The Reference Component
  125.      */

  126.     public org.drip.product.definition.CalibratableComponent referenceComponent()
  127.     {
  128.         return _rcReference;
  129.     }

  130.     /**
  131.      * Retrieve the Derived Component
  132.      *
  133.      * @return The Derived Component
  134.      */

  135.     public org.drip.product.definition.CalibratableComponent derivedComponent()
  136.     {
  137.         return _rcDerived;
  138.     }

  139.     /**
  140.      * Retrieve the FX Fixing Setting
  141.      *
  142.      * @return The FX Fixing Setting
  143.      */

  144.     public org.drip.param.period.FixingSetting fxFixingSetting()
  145.     {
  146.         return _fxFixingSetting;
  147.     }

  148.     /**
  149.      * Retrieve the FX Code
  150.      *
  151.      * @return The FX Code
  152.      */

  153.     public java.lang.String fxCode()
  154.     {
  155.         java.lang.String strDerivedComponentCouponCurrency = _rcDerived.payCurrency();

  156.         java.lang.String strReferenceComponentCouponCurrency = _rcReference.payCurrency();

  157.         return strDerivedComponentCouponCurrency.equalsIgnoreCase (strReferenceComponentCouponCurrency) ?
  158.             null : strReferenceComponentCouponCurrency + "/" + strDerivedComponentCouponCurrency;
  159.     }

  160.     /**
  161.      * Generate the Derived Forward Latent State Segment Specification
  162.      *
  163.      * @param valParams Valuation Parameters
  164.      * @param mktParams Market Parameters
  165.      * @param dblBasis The Basis on either the Reference Component or the Derived Component
  166.      * @param bBasisOnDerivedComponent TRUE - Apply the Basis on the Derived Component
  167.      * @param bBasisOnDerivedStream TRUE - Apply the Basis on the Derived Stream (FALSE - Reference Stream)
  168.      *
  169.      * @return The Derived Forward Latent State Segment Specification
  170.      */

  171.     public org.drip.state.inference.LatentStateSegmentSpec derivedForwardSpec (
  172.         final org.drip.param.valuation.ValuationParams valParams,
  173.         final org.drip.param.market.CurveSurfaceQuoteContainer mktParams,
  174.         final double dblBasis,
  175.         final boolean bBasisOnDerivedComponent,
  176.         final boolean bBasisOnDerivedStream)
  177.     {
  178.         org.drip.product.calib.ProductQuoteSet pqs = null;
  179.         org.drip.state.identifier.ForwardLabel forwardLabel = null;

  180.         org.drip.product.definition.CalibratableComponent comp = derivedComponent();

  181.         if (comp instanceof org.drip.product.rates.DualStreamComponent)
  182.             forwardLabel = ((org.drip.product.rates.DualStreamComponent)
  183.                 comp).derivedStream().forwardLabel();
  184.         else {
  185.             org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.state.identifier.ForwardLabel>
  186.                 mapForwardLabel = comp.forwardLabel();

  187.             if (null != mapForwardLabel && 0 != mapForwardLabel.size())
  188.                 forwardLabel = mapForwardLabel.get ("BASE");
  189.         }

  190.         try {
  191.             pqs = comp.calibQuoteSet (new org.drip.state.representation.LatentStateSpecification[] {new
  192.                 org.drip.state.representation.LatentStateSpecification
  193.                     (org.drip.analytics.definition.LatentStateStatic.LATENT_STATE_FORWARD,
  194.                         org.drip.analytics.definition.LatentStateStatic.FORWARD_QM_FORWARD_RATE,
  195.                             forwardLabel)});
  196.         } catch (java.lang.Exception e) {
  197.             e.printStackTrace();

  198.             return null;
  199.         }

  200.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapOP = value (valParams, null,
  201.             mktParams, null);

  202.         org.drip.product.definition.CalibratableComponent rcReference = referenceComponent();

  203.         java.lang.String strReferenceComponentName = rcReference.name();

  204.         org.drip.product.definition.CalibratableComponent rcDerived = derivedComponent();

  205.         java.lang.String strDerivedComponentName = rcDerived.name();

  206.         java.lang.String strReferenceComponentPV = strReferenceComponentName + "[PV]";

  207.         if (!bBasisOnDerivedComponent) {
  208.             java.lang.String strReferenceComponentDerivedStreamCleanDV01 = strReferenceComponentName +
  209.                 "[DerivedCleanDV01]";
  210.             java.lang.String strReferenceComponentReferenceStreamCleanDV01 = strReferenceComponentName +
  211.                 "[ReferenceCleanDV01]";

  212.             if (null == mapOP || !mapOP.containsKey (strReferenceComponentPV) || !mapOP.containsKey
  213.                 (strReferenceComponentReferenceStreamCleanDV01) || !mapOP.containsKey
  214.                     (strReferenceComponentDerivedStreamCleanDV01))
  215.                 return null;

  216.             if (!pqs.set ("PV", -1. * (mapOP.get (strReferenceComponentPV) + 10000. * (bBasisOnDerivedStream
  217.                 ? mapOP.get (strReferenceComponentDerivedStreamCleanDV01) : mapOP.get
  218.                     (strReferenceComponentReferenceStreamCleanDV01)) * dblBasis)))
  219.                 return null;
  220.         } else {
  221.             java.lang.String strDerivedComponentReferenceStreamCleanDV01 = strDerivedComponentName +
  222.                 "[ReferenceCleanDV01]";
  223.             java.lang.String strDerivedComponentDerivedStreamCleanDV01 = strDerivedComponentName +
  224.                 "[DerivedCleanDV01]";

  225.             if (null == mapOP || !mapOP.containsKey (strReferenceComponentPV) || !mapOP.containsKey
  226.                 (strDerivedComponentReferenceStreamCleanDV01) || !mapOP.containsKey
  227.                     (strDerivedComponentDerivedStreamCleanDV01))
  228.                 return null;

  229.             if (!pqs.set ("PV", -1. * (mapOP.get (strReferenceComponentPV) + 10000. * (bBasisOnDerivedStream
  230.                 ? mapOP.get (strDerivedComponentDerivedStreamCleanDV01) : mapOP.get
  231.                     (strDerivedComponentReferenceStreamCleanDV01)) * dblBasis)))
  232.                 return null;
  233.         }

  234.         try {
  235.             return new org.drip.state.inference.LatentStateSegmentSpec (comp, pqs);
  236.         } catch (java.lang.Exception e) {
  237.             e.printStackTrace();
  238.         }

  239.         return null;
  240.     }

  241.     /**
  242.      * Generate the Derived Funding/Forward Merged Latent State Segment Specification
  243.      *
  244.      * @param valParams Valuation Parameters
  245.      * @param mktParams Market Parameters
  246.      * @param dblReferenceComponentBasis The Reference Component Basis
  247.      * @param bBasisOnDerivedLeg TRUE - Apply basis on the Derived Leg
  248.      * @param dblSwapRate The Swap Rate
  249.      *
  250.      * @return The Derived Forward/Funding Latent State Segment Specification
  251.      */

  252.     public org.drip.state.inference.LatentStateSegmentSpec derivedFundingForwardSpec (
  253.         final org.drip.param.valuation.ValuationParams valParams,
  254.         final org.drip.param.market.CurveSurfaceQuoteContainer mktParams,
  255.         final double dblReferenceComponentBasis,
  256.         final boolean bBasisOnDerivedLeg,
  257.         final double dblSwapRate)
  258.     {
  259.         double dblFX = 1.;
  260.         org.drip.product.calib.ProductQuoteSet pqs = null;
  261.         org.drip.state.identifier.ForwardLabel forwardLabel = null;
  262.         org.drip.state.identifier.FundingLabel fundingLabel = null;

  263.         org.drip.product.definition.CalibratableComponent compDerived = derivedComponent();

  264.         org.drip.product.definition.CalibratableComponent compReference = referenceComponent();

  265.         if (compDerived instanceof org.drip.product.rates.DualStreamComponent) {
  266.             org.drip.product.rates.Stream streamDerived = ((org.drip.product.rates.DualStreamComponent)
  267.                 compDerived).derivedStream();

  268.             forwardLabel = streamDerived.forwardLabel();

  269.             fundingLabel = streamDerived.fundingLabel();
  270.         } else {
  271.             org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.state.identifier.ForwardLabel>
  272.                 mapForwardLabel = compDerived.forwardLabel();

  273.             org.drip.state.identifier.FundingLabel fundingLabelDerived = compDerived.fundingLabel();

  274.             if (null != mapForwardLabel && 0 != mapForwardLabel.size())
  275.                 forwardLabel = mapForwardLabel.get ("DERIVED");

  276.             if (null != fundingLabelDerived) fundingLabel = fundingLabelDerived;
  277.         }

  278.         try {
  279.             pqs = compDerived.calibQuoteSet (new org.drip.state.representation.LatentStateSpecification[]
  280.                 {new org.drip.state.representation.LatentStateSpecification
  281.                     (org.drip.analytics.definition.LatentStateStatic.LATENT_STATE_FUNDING,
  282.                         org.drip.analytics.definition.LatentStateStatic.DISCOUNT_QM_DISCOUNT_FACTOR,
  283.                             fundingLabel), new org.drip.state.representation.LatentStateSpecification
  284.                                 (org.drip.analytics.definition.LatentStateStatic.LATENT_STATE_FORWARD,
  285.                                     org.drip.analytics.definition.LatentStateStatic.FORWARD_QM_FORWARD_RATE,
  286.                                         forwardLabel)});

  287.             if (null != _fxFixingSetting && org.drip.param.period.FixingSetting.FIXING_PRESET_STATIC ==
  288.                 _fxFixingSetting.type()) {
  289.                 org.drip.state.fx.FXCurve fxfc = mktParams.fxState (fxLabel()[0]);

  290.                 if (null == fxfc) return null;

  291.                 dblFX = fxfc.fx (_fxFixingSetting.staticDate());
  292.             }
  293.         } catch (java.lang.Exception e) {
  294.             e.printStackTrace();

  295.             return null;
  296.         }

  297.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapOP = compReference.value
  298.             (valParams, null, mktParams, null);

  299.         if (null == mapOP || !mapOP.containsKey ("PV") || !pqs.set ("SwapRate", dblSwapRate)) return null;

  300.         if (bBasisOnDerivedLeg) {
  301.             if (!mapOP.containsKey ("DerivedCleanDV01") || !pqs.set ("PV", dblFX * (mapOP.get ("PV") + 10000.
  302.                 * mapOP.get ("DerivedCleanDV01") * dblReferenceComponentBasis)))
  303.                 return null;
  304.         } else {
  305.             if (!mapOP.containsKey ("ReferenceCleanDV01") || !pqs.set ("PV", -1. * dblFX * (mapOP.get ("PV")
  306.                 + 10000. * mapOP.get ("ReferenceCleanDV01") * dblReferenceComponentBasis)))
  307.                 return null;
  308.         }

  309.         try {
  310.             return new org.drip.state.inference.LatentStateSegmentSpec (compDerived, pqs);
  311.         } catch (java.lang.Exception e) {
  312.             e.printStackTrace();
  313.         }

  314.         return null;
  315.     }

  316.     @Override public java.lang.String name()
  317.     {
  318.         return _strName;
  319.     }

  320.     @Override public org.drip.state.identifier.FXLabel[] fxLabel()
  321.     {
  322.         java.lang.String strReferenceCurrency = _rcReference.payCurrency();

  323.         java.lang.String strDerivedCurrency = _rcDerived.payCurrency();

  324.         return new org.drip.state.identifier.FXLabel[] {org.drip.state.identifier.FXLabel.Standard
  325.             (strReferenceCurrency + "/" + strDerivedCurrency), org.drip.state.identifier.FXLabel.Standard
  326.                 (strDerivedCurrency + "/" + strReferenceCurrency)};
  327.     }

  328.     @Override public org.drip.product.definition.Component[] components()
  329.     {
  330.         return new org.drip.product.definition.Component[] {_rcReference, _rcDerived};
  331.     }

  332.     @Override public int measureAggregationType (
  333.         final java.lang.String strMeasureName)
  334.     {
  335.         return org.drip.product.definition.BasketProduct.MEASURE_AGGREGATION_TYPE_UNIT_ACCUMULATE;
  336.     }

  337.     @Override public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value (
  338.         final org.drip.param.valuation.ValuationParams valParams,
  339.         final org.drip.param.pricer.CreditPricerParams pricerParams,
  340.         final org.drip.param.market.CurveSurfaceQuoteContainer csqs,
  341.         final org.drip.param.valuation.ValuationCustomizationParams vcp)
  342.     {
  343.         long lStart = System.nanoTime();

  344.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapOutput = super.value
  345.             (valParams, pricerParams, csqs, vcp);

  346.         if (null == mapOutput) return null;

  347.         org.drip.product.definition.CalibratableComponent rcReference = referenceComponent();

  348.         org.drip.product.definition.CalibratableComponent rcDerived = derivedComponent();

  349.         java.lang.String strReferenceCompName = rcReference.name();

  350.         java.lang.String strDerivedCompName = rcDerived.name();

  351.         java.lang.String strDerivedCompPV = strDerivedCompName + "[PV]";
  352.         java.lang.String strReferenceCompPV = strReferenceCompName + "[PV]";
  353.         java.lang.String strDerivedCompDerivedDV01 = strDerivedCompName + "[DerivedCleanDV01]";
  354.         java.lang.String strReferenceCompDerivedDV01 = strReferenceCompName + "[DerivedCleanDV01]";
  355.         java.lang.String strDerivedCompReferenceDV01 = strDerivedCompName + "[ReferenceCleanDV01]";
  356.         java.lang.String strReferenceCompReferenceDV01 = strReferenceCompName + "[ReferenceCleanDV01]";
  357.         java.lang.String strDerivedCompCumulativeConvexityPremium = strDerivedCompName +
  358.             "[CumulativeConvexityAdjustmentPremium]";
  359.         java.lang.String strDerivedCompCumulativeConvexityAdjustment = strDerivedCompName +
  360.             "[CumulativeConvexityAdjustmentFactor]";
  361.         java.lang.String strReferenceCompCumulativeConvexityPremium = strReferenceCompName +
  362.             "[CumulativeConvexityAdjustmentPremium]";
  363.         java.lang.String strReferenceCompCumulativeConvexityAdjustment = strReferenceCompName +
  364.             "[QuantoAdjustmentFactor]";

  365.         if (!mapOutput.containsKey (strDerivedCompPV) || !mapOutput.containsKey (strReferenceCompPV) ||
  366.             !mapOutput.containsKey (strReferenceCompReferenceDV01) || !mapOutput.containsKey
  367.                 (strReferenceCompDerivedDV01) || !mapOutput.containsKey (strDerivedCompReferenceDV01) ||
  368.                     !mapOutput.containsKey (strDerivedCompDerivedDV01) || !mapOutput.containsKey
  369.                         (strDerivedCompCumulativeConvexityPremium) || !mapOutput.containsKey
  370.                             (strReferenceCompCumulativeConvexityPremium)) {
  371.             mapOutput.put ("CalcTime", (System.nanoTime() - lStart) * 1.e-09);

  372.             return mapOutput;
  373.         }

  374.         double dblDerivedCompPV = mapOutput.get (strDerivedCompPV);

  375.         double dblReferenceCompPV = mapOutput.get (strReferenceCompPV);

  376.         double dblDerivedCompDerivedDV01 = mapOutput.get (strDerivedCompDerivedDV01);

  377.         double dblDerivedCompReferenceDV01 = mapOutput.get (strDerivedCompReferenceDV01);

  378.         double dblReferenceCompDerivedDV01 = mapOutput.get (strReferenceCompDerivedDV01);

  379.         double dblReferenceCompReferenceDV01 = mapOutput.get (strReferenceCompReferenceDV01);

  380.         mapOutput.put ("ReferenceCompReferenceBasis", -1. * (dblDerivedCompPV + dblReferenceCompPV) /
  381.             dblReferenceCompReferenceDV01);

  382.         mapOutput.put ("ReferenceCompDerivedBasis", -1. * (dblDerivedCompPV + dblReferenceCompPV) /
  383.             dblReferenceCompDerivedDV01);

  384.         mapOutput.put ("DerivedCompReferenceBasis", -1. * (dblDerivedCompPV + dblReferenceCompPV) /
  385.             dblDerivedCompReferenceDV01);

  386.         mapOutput.put ("DerivedCompDerivedBasis", -1. * (dblDerivedCompPV + dblReferenceCompPV) /
  387.             dblDerivedCompDerivedDV01);

  388.         if (mapOutput.containsKey (strReferenceCompCumulativeConvexityAdjustment))
  389.             mapOutput.put ("ReferenceCumulativeConvexityAdjustmentFactor", mapOutput.get
  390.                 (strReferenceCompCumulativeConvexityAdjustment));

  391.         double dblReferenceCumulativeConvexityAdjustmentPremium = mapOutput.get
  392.             (strReferenceCompCumulativeConvexityPremium);

  393.         mapOutput.put ("ReferenceCumulativeConvexityAdjustmentPremium",
  394.             dblReferenceCumulativeConvexityAdjustmentPremium);

  395.         if (mapOutput.containsKey (strDerivedCompCumulativeConvexityAdjustment))
  396.             mapOutput.put ("DerivedCumulativeConvexityAdjustmentFactor", mapOutput.get
  397.                 (strDerivedCompCumulativeConvexityAdjustment));

  398.         double dblDerivedCumulativeConvexityAdjustmentPremium = mapOutput.get
  399.             (strDerivedCompCumulativeConvexityPremium);

  400.         mapOutput.put ("DerivedCumulativeConvexityAdjustmentPremium",
  401.             dblDerivedCumulativeConvexityAdjustmentPremium);

  402.         try {
  403.             mapOutput.put ("CumulativeConvexityAdjustmentPremium", _rcReference.initialNotional() *
  404.                 dblReferenceCumulativeConvexityAdjustmentPremium + _rcDerived.initialNotional() *
  405.                     dblDerivedCumulativeConvexityAdjustmentPremium);
  406.         } catch (java.lang.Exception e) {
  407.             e.printStackTrace();

  408.             return null;
  409.         }

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

  411.         return mapOutput;
  412.     }
  413. }