Reconciler_Fixed.java

  1. package org.drip.sample.bondmetrics;

  2. import java.util.*;

  3. import org.drip.analytics.date.*;
  4. import org.drip.numerical.common.FormatUtil;
  5. import org.drip.param.creator.MarketParamsBuilder;
  6. import org.drip.param.market.CurveSurfaceQuoteContainer;
  7. import org.drip.param.valuation.*;
  8. import org.drip.product.creator.BondBuilder;
  9. import org.drip.product.credit.BondComponent;
  10. import org.drip.product.params.EmbeddedOptionSchedule;
  11. import org.drip.service.env.EnvManager;
  12. import org.drip.service.scenario.*;
  13. import org.drip.service.template.LatentMarketStateBuilder;
  14. import org.drip.state.creator.ScenarioCreditCurveBuilder;
  15. import org.drip.state.credit.CreditCurve;
  16. import org.drip.state.discount.MergedDiscountForwardCurve;
  17. import org.drip.state.govvie.GovvieCurve;

  18. /*
  19.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  20.  */

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

  92. /**
  93.  * <i>Reconciler_Fixed</i> demonstrates the Analytics Calculation/Reconciliation for the the Fixed Coupon
  94.  * Bond MCQGQO.
  95.  *  
  96.  * <br><br>
  97.  *  <ul>
  98.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  99.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  100.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">DROP API Construction and Usage</a></li>
  101.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/bondmetrics/README.md">Bond Relative Value Replication Demonstration</a></li>
  102.  *  </ul>
  103.  * <br><br>
  104.  *
  105.  * @author Lakshmi Krishnamurthy
  106.  */

  107. public class Reconciler_Fixed {

  108.     private static final MergedDiscountForwardCurve FundingCurve (
  109.         final JulianDate dtSpot,
  110.         final String strCurrency,
  111.         final double dblBump)
  112.         throws Exception
  113.     {
  114.         String[] astrDepositMaturityTenor = new String[] {
  115.             "2D"
  116.         };

  117.         double[] adblDepositQuote = new double[] {
  118.             0.0130411 + dblBump // 2D
  119.         };

  120.         double[] adblFuturesQuote = new double[] {
  121.             0.01345 + dblBump,  // 98.655
  122.             0.01470 + dblBump,  // 98.530
  123.             0.01575 + dblBump,  // 98.425
  124.             0.01660 + dblBump,  // 98.340
  125.             0.01745 + dblBump,  // 98.255
  126.             0.01845 + dblBump   // 98.155
  127.         };

  128.         String[] astrFixFloatMaturityTenor = new String[] {
  129.             "02Y",
  130.             "03Y",
  131.             "04Y",
  132.             "05Y",
  133.             "06Y",
  134.             "07Y",
  135.             "08Y",
  136.             "09Y",
  137.             "10Y",
  138.             "11Y",
  139.             "12Y",
  140.             "15Y",
  141.             "20Y",
  142.             "25Y",
  143.             "30Y",
  144.             "40Y",
  145.             "50Y"
  146.         };

  147.         double[] adblFixFloatQuote = new double[] {
  148.             0.016410 + dblBump, //  2Y
  149.             0.017863 + dblBump, //  3Y
  150.             0.019030 + dblBump, //  4Y
  151.             0.020035 + dblBump, //  5Y
  152.             0.020902 + dblBump, //  6Y
  153.             0.021660 + dblBump, //  7Y
  154.             0.022307 + dblBump, //  8Y
  155.             0.022879 + dblBump, //  9Y
  156.             0.023363 + dblBump, // 10Y
  157.             0.023820 + dblBump, // 11Y
  158.             0.024172 + dblBump, // 12Y
  159.             0.024934 + dblBump, // 15Y
  160.             0.025581 + dblBump, // 20Y
  161.             0.025906 + dblBump, // 25Y
  162.             0.025973 + dblBump, // 30Y
  163.             0.025838 + dblBump, // 40Y
  164.             0.025560 + dblBump  // 50Y
  165.         };

  166.         return LatentMarketStateBuilder.SmoothFundingCurve (
  167.             dtSpot,
  168.             strCurrency,
  169.             astrDepositMaturityTenor,
  170.             adblDepositQuote,
  171.             "ForwardRate",
  172.             adblFuturesQuote,
  173.             "ForwardRate",
  174.             astrFixFloatMaturityTenor,
  175.             adblFixFloatQuote,
  176.             "SwapRate"
  177.         );
  178.     }

  179.     private static final Map<String, MergedDiscountForwardCurve> TenorBumpedFundingCurve (
  180.         final JulianDate dtSpot,
  181.         final String strCurrency,
  182.         final double dblBump)
  183.         throws Exception
  184.     {
  185.         String[] astrDepositMaturityTenor = new String[] {
  186.             "2D"
  187.         };

  188.         double[] adblDepositQuote = new double[] {
  189.             0.0130411 // 2D
  190.         };

  191.         double[] adblFuturesQuote = new double[] {
  192.             0.01345,    // 98.655
  193.             0.01470,    // 98.530
  194.             0.01575,    // 98.425
  195.             0.01660,    // 98.340
  196.             0.01745,    // 98.255
  197.             0.01845     // 98.155
  198.         };

  199.         String[] astrFixFloatMaturityTenor = new String[] {
  200.             "02Y",
  201.             "03Y",
  202.             "04Y",
  203.             "05Y",
  204.             "06Y",
  205.             "07Y",
  206.             "08Y",
  207.             "09Y",
  208.             "10Y",
  209.             "11Y",
  210.             "12Y",
  211.             "15Y",
  212.             "20Y",
  213.             "25Y",
  214.             "30Y",
  215.             "40Y",
  216.             "50Y"
  217.         };

  218.         double[] adblFixFloatQuote = new double[] {
  219.             0.016410, //  2Y
  220.             0.017863, //  3Y
  221.             0.019030, //  4Y
  222.             0.020035, //  5Y
  223.             0.020902, //  6Y
  224.             0.021660, //  7Y
  225.             0.022307, //  8Y
  226.             0.022879, //  9Y
  227.             0.023363, // 10Y
  228.             0.023820, // 11Y
  229.             0.024172, // 12Y
  230.             0.024934, // 15Y
  231.             0.025581, // 20Y
  232.             0.025906, // 25Y
  233.             0.025973, // 30Y
  234.             0.025838, // 40Y
  235.             0.025560  // 50Y
  236.         };

  237.         return LatentMarketStateBuilder.BumpedFundingCurve (
  238.             dtSpot,
  239.             strCurrency,
  240.             astrDepositMaturityTenor,
  241.             adblDepositQuote,
  242.             "ForwardRate",
  243.             adblFuturesQuote,
  244.             "ForwardRate",
  245.             astrFixFloatMaturityTenor,
  246.             adblFixFloatQuote,
  247.             "SwapRate",
  248.             LatentMarketStateBuilder.SMOOTH,
  249.             dblBump,
  250.             false
  251.         );
  252.     }

  253.     private static final GovvieCurve GovvieCurve (
  254.         final JulianDate dtSpot,
  255.         final String strCode,
  256.         final double[] adblGovvieYield)
  257.         throws Exception
  258.     {
  259.         return LatentMarketStateBuilder.GovvieCurve (
  260.             strCode,
  261.             dtSpot,
  262.             new JulianDate[] {
  263.                 dtSpot,
  264.                 dtSpot,
  265.                 dtSpot,
  266.                 dtSpot,
  267.                 dtSpot,
  268.                 dtSpot,
  269.                 dtSpot,
  270.                 dtSpot
  271.             },
  272.             new JulianDate[] {
  273.                 dtSpot.addTenor ("1Y"),
  274.                 dtSpot.addTenor ("2Y"),
  275.                 dtSpot.addTenor ("3Y"),
  276.                 dtSpot.addTenor ("5Y"),
  277.                 dtSpot.addTenor ("7Y"),
  278.                 dtSpot.addTenor ("10Y"),
  279.                 dtSpot.addTenor ("20Y"),
  280.                 dtSpot.addTenor ("30Y")
  281.             },
  282.             adblGovvieYield,
  283.             adblGovvieYield,
  284.             "Yield",
  285.             LatentMarketStateBuilder.SHAPE_PRESERVING
  286.         );
  287.     }

  288.     private static final Map<String, GovvieCurve> TenorBumpedGovvieCurve (
  289.         final JulianDate dtSpot,
  290.         final String strCode,
  291.         final double dblBump,
  292.         final double[] adblGovvieYield)
  293.         throws Exception
  294.     {
  295.         return LatentMarketStateBuilder.BumpedGovvieCurve (
  296.             strCode,
  297.             dtSpot,
  298.             new JulianDate[] {
  299.                 dtSpot,
  300.                 dtSpot,
  301.                 dtSpot,
  302.                 dtSpot,
  303.                 dtSpot,
  304.                 dtSpot,
  305.                 dtSpot,
  306.                 dtSpot
  307.             },
  308.             new JulianDate[] {
  309.                 dtSpot.addTenor ("1Y"),
  310.                 dtSpot.addTenor ("2Y"),
  311.                 dtSpot.addTenor ("3Y"),
  312.                 dtSpot.addTenor ("5Y"),
  313.                 dtSpot.addTenor ("7Y"),
  314.                 dtSpot.addTenor ("10Y"),
  315.                 dtSpot.addTenor ("20Y"),
  316.                 dtSpot.addTenor ("30Y")
  317.             },
  318.             adblGovvieYield,
  319.             adblGovvieYield,
  320.             "Yield",
  321.             LatentMarketStateBuilder.SHAPE_PRESERVING,
  322.             dblBump,
  323.             false
  324.         );
  325.     }

  326.     private static final CreditCurve CreditCurve (
  327.         final JulianDate dtSpot,
  328.         final String strCreditCurve,
  329.         final MergedDiscountForwardCurve mdfc,
  330.         final String[] astrCreditTenor,
  331.         final double dblBump)
  332.         throws Exception
  333.     {
  334.         CreditCurve cc = ScenarioCreditCurveBuilder.Survival (
  335.             dtSpot.julian(),
  336.             strCreditCurve,
  337.             mdfc.currency(),
  338.             astrCreditTenor,
  339.             new double[] {
  340.                  0.995 - 0.0001 * dblBump,  //  6M
  341.                  0.990 - 0.0001 * dblBump,  //  1Y
  342.                  0.980 - 0.0001 * dblBump,  //  2Y
  343.                  0.970 - 0.0001 * dblBump,  //  3Y
  344.                  0.960 - 0.0001 * dblBump,  //  4Y
  345.                  0.950 - 0.0001 * dblBump,  //  5Y
  346.                  0.940 - 0.0001 * dblBump,  //  7Y
  347.                  0.910 - 0.0001 * dblBump   // 10Y
  348.             },
  349.             0.4
  350.         );

  351.         return cc;
  352.     }

  353.     private static final Map<String, CreditCurve> TenorBumpedCreditCurve (
  354.         final JulianDate dtSpot,
  355.         final String strCreditCurve,
  356.         final MergedDiscountForwardCurve mdfc,
  357.         final double dblBump)
  358.         throws Exception
  359.     {
  360.         return LatentMarketStateBuilder.BumpedCreditCurve (
  361.             dtSpot,
  362.             strCreditCurve,
  363.             new String[] {
  364.                 "06M",
  365.                 "01Y",
  366.                 "02Y",
  367.                 "03Y",
  368.                 "04Y",
  369.                 "05Y",
  370.                 "07Y",
  371.                 "10Y"
  372.             },
  373.             new double[] {
  374.                  60.,   //  6M
  375.                  68.,   //  1Y
  376.                  88.,   //  2Y
  377.                 102.,   //  3Y
  378.                 121.,   //  4Y
  379.                 138.,   //  5Y
  380.                 168.,   //  7Y
  381.                 188.    // 10Y
  382.             },
  383.             new double[] {
  384.                  60.,   //  6M
  385.                  68.,   //  1Y
  386.                  88.,   //  2Y
  387.                 102.,   //  3Y
  388.                 121.,   //  4Y
  389.                 138.,   //  5Y
  390.                 168.,   //  7Y
  391.                 188.    // 10Y
  392.             },
  393.             "FairPremium",
  394.             mdfc,
  395.             dblBump,
  396.             false
  397.         );
  398.     }

  399.     private static final void SetEOS (
  400.         final BondComponent bond,
  401.         final EmbeddedOptionSchedule eosCall,
  402.         final EmbeddedOptionSchedule eosPut)
  403.         throws java.lang.Exception
  404.     {
  405.         if (null != eosPut) bond.setEmbeddedPutSchedule (eosPut);

  406.         if (null != eosCall) bond.setEmbeddedCallSchedule (eosCall);
  407.     }

  408.     private static final int NextCallDate (
  409.         final BondComponent bond,
  410.         final int iSpotDate)
  411.         throws java.lang.Exception
  412.     {
  413.         EmbeddedOptionSchedule eosCall = bond.callSchedule();

  414.         return null == eosCall ? bond.maturityDate().julian() : eosCall.nextDate (iSpotDate);
  415.     }

  416.     private static final double NextCallFactor (
  417.         final BondComponent bond,
  418.         final int iSpotDate)
  419.         throws java.lang.Exception
  420.     {
  421.         EmbeddedOptionSchedule eosCall = bond.callSchedule();

  422.         return null == eosCall ? 1. : eosCall.nextFactor (iSpotDate);
  423.     }

  424.     public static final void main (
  425.         final String[] astrArgs)
  426.         throws Exception
  427.     {
  428.         EnvManager.InitEnv (
  429.             "",
  430.             true
  431.         );

  432.         JulianDate dtSpot = DateUtil.CreateFromYMD (
  433.             2017,
  434.             DateUtil.JULY,
  435.             10
  436.         );

  437.         String[] astrDepositTenor = new String[] {
  438.             "2D"
  439.         };

  440.         double[] adblDepositQuote = new double[] {
  441.             0.0130411 // 2D
  442.         };

  443.         double[] adblFuturesQuote = new double[] {
  444.             0.01345,    // 98.655
  445.             0.01470,    // 98.530
  446.             0.01575,    // 98.425
  447.             0.01660,    // 98.340
  448.             0.01745,    // 98.255
  449.             0.01845     // 98.155
  450.         };

  451.         String[] astrFixFloatTenor = new String[] {
  452.             "02Y",
  453.             "03Y",
  454.             "04Y",
  455.             "05Y",
  456.             "06Y",
  457.             "07Y",
  458.             "08Y",
  459.             "09Y",
  460.             "10Y",
  461.             "11Y",
  462.             "12Y",
  463.             "15Y",
  464.             "20Y",
  465.             "25Y",
  466.             "30Y",
  467.             "40Y",
  468.             "50Y"
  469.         };

  470.         String[] astrGovvieTenor = new String[] {
  471.             "1Y",
  472.             "2Y",
  473.             "3Y",
  474.             "5Y",
  475.             "7Y",
  476.             "10Y",
  477.             "20Y",
  478.             "30Y"
  479.         };

  480.         double[] adblFixFloatQuote = new double[] {
  481.             0.016410, //  2Y
  482.             0.017863, //  3Y
  483.             0.019030, //  4Y
  484.             0.020035, //  5Y
  485.             0.020902, //  6Y
  486.             0.021660, //  7Y
  487.             0.022307, //  8Y
  488.             0.022879, //  9Y
  489.             0.023363, // 10Y
  490.             0.023820, // 11Y
  491.             0.024172, // 12Y
  492.             0.024934, // 15Y
  493.             0.025581, // 20Y
  494.             0.025906, // 25Y
  495.             0.025973, // 30Y
  496.             0.025838, // 40Y
  497.             0.025560  // 50Y
  498.         };

  499.         double[] adblGovvieYield = new double[] {
  500.             0.01219, //  1Y
  501.             0.01391, //  2Y
  502.             0.01590, //  3Y
  503.             0.01937, //  5Y
  504.             0.02200, //  7Y
  505.             0.02378, // 10Y
  506.             0.02677, // 20Y
  507.             0.02927  // 30Y
  508.         };

  509.         String[] astrCreditTenor = new String[] {
  510.             "06M",
  511.             "01Y",
  512.             "02Y",
  513.             "03Y",
  514.             "04Y",
  515.             "05Y",
  516.             "07Y",
  517.             "10Y"
  518.         };

  519.         double[] adblCreditQuote = new double[] {
  520.              60.,   //  6M
  521.              68.,   //  1Y
  522.              88.,   //  2Y
  523.             102.,   //  3Y
  524.             121.,   //  4Y
  525.             138.,   //  5Y
  526.             168.,   //  7Y
  527.             188.    // 10Y
  528.         };

  529.         double dblFX = 1.;
  530.         int iSettleLag = 3;
  531.         int iCouponFreq = 12;
  532.         String strName = "MCQGQO";
  533.         double dblCleanPrice = 1.;
  534.         double dblIssuePrice = 1.;
  535.         String strCurrency = "USD";
  536.         double dblSpreadBump = 20.;
  537.         double dblCouponRate = 0.0425;
  538.         double dblIssueAmount = 2.60e7;
  539.         String strTreasuryCode = "UST";
  540.         String strCouponDayCount = "30/360";
  541.         double dblSpreadDurationMultiplier = 5.;

  542.         JulianDate dtEffective = DateUtil.CreateFromYMD (
  543.             2015,
  544.             9,
  545.             18
  546.         );

  547.         JulianDate dtMaturity = DateUtil.CreateFromYMD (
  548.             2025,
  549.             10,
  550.             1
  551.         );

  552.         BondComponent bond = BondBuilder.CreateSimpleFixed (
  553.             strName,
  554.             strCurrency,       // Coupon Currency
  555.             strName,
  556.             dblCouponRate,     // Coupon Rate
  557.             iCouponFreq,       // Coupon Frequency
  558.             strCouponDayCount, // Coupon Day Count
  559.             dtEffective,       // Effective Date
  560.             dtMaturity,        // Maturity Date
  561.             null,
  562.             null
  563.         );

  564.         SetEOS (
  565.             bond,
  566.             null,
  567.             null
  568.         );

  569.         int iSpotDate = dtSpot.julian();

  570.         JulianDate dtSettle = dtSpot.addBusDays (
  571.             iSettleLag,
  572.             strCurrency
  573.         );

  574.         ValuationParams valParams = new ValuationParams (
  575.             dtSpot,
  576.             dtSettle,
  577.             strCurrency
  578.         );

  579.         MergedDiscountForwardCurve mdfcBase = FundingCurve (
  580.             dtSpot,
  581.             strCurrency,
  582.             0.
  583.         );

  584.         GovvieCurve gc = GovvieCurve (
  585.             dtSpot,
  586.             strTreasuryCode,
  587.             adblGovvieYield
  588.         );

  589.         CurveSurfaceQuoteContainer csqcBase = MarketParamsBuilder.Create (
  590.             mdfcBase,
  591.             gc,
  592.             null,
  593.             null,
  594.             null,
  595.             null,
  596.             null
  597.         );

  598.         CurveSurfaceQuoteContainer csqcCreditBase = MarketParamsBuilder.Create (
  599.             mdfcBase,
  600.             gc,
  601.             CreditCurve (
  602.                 dtSpot,
  603.                 strName,
  604.                 mdfcBase,
  605.                 astrCreditTenor,
  606.                 0.
  607.             ),
  608.             null,
  609.             null,
  610.             null,
  611.             null
  612.         );

  613.         CurveSurfaceQuoteContainer csqcBumped01Up = MarketParamsBuilder.Create (
  614.             FundingCurve (
  615.                 dtSpot,
  616.                 strCurrency,
  617.                 0.0001
  618.             ),
  619.             gc,
  620.             null,
  621.             null,
  622.             null,
  623.             null,
  624.             null
  625.         );

  626.         CurveSurfaceQuoteContainer csqcCreditBumped01Up = MarketParamsBuilder.Create (
  627.             mdfcBase,
  628.             gc,
  629.             CreditCurve (
  630.                 dtSpot,
  631.                 strName,
  632.                 mdfcBase,
  633.                 astrCreditTenor,
  634.                 1.
  635.             ),
  636.             null,
  637.             null,
  638.             null,
  639.             null
  640.         );

  641.         double dblAccrued = bond.accrued (
  642.             dtSettle.julian(),
  643.             csqcBase
  644.         );

  645.         WorkoutInfo wi = bond.exerciseYieldFromPrice (
  646.             valParams,
  647.             csqcBase,
  648.             null,
  649.             dblCleanPrice
  650.         );

  651.         double dblBondBasisToMaturity = bond.bondBasisFromPrice (
  652.             valParams,
  653.             csqcBase,
  654.             null,
  655.             dblCleanPrice
  656.         );

  657.         double dblModifiedDurationToMaturity = (
  658.             dblCleanPrice - bond.priceFromBondBasis (
  659.                 valParams,
  660.                 csqcBumped01Up,
  661.                 null,
  662.                 dblBondBasisToMaturity
  663.             )
  664.         ) / dblCleanPrice;

  665.         double dblYieldToMaturity = bond.yieldFromPrice (
  666.             valParams,
  667.             csqcBase,
  668.             null,
  669.             dblCleanPrice
  670.         );

  671.         double dblBondEquivalentYieldToMaturity = bond.yieldFromPrice (
  672.             valParams,
  673.             csqcBase,
  674.             ValuationCustomizationParams.BondEquivalent (strCurrency),
  675.             dblCleanPrice
  676.         );

  677.         double dblFlatForwardRateYieldToMaturity = bond.yieldFromPrice (
  678.             valParams,
  679.             csqcBase,
  680.             new ValuationCustomizationParams (
  681.                 strCouponDayCount,
  682.                 iCouponFreq,
  683.                 false,
  684.                 null,
  685.                 strCurrency,
  686.                 false,
  687.                 true
  688.             ),
  689.             dblCleanPrice
  690.         );

  691.         double dblYieldToExercise = bond.yieldFromPrice (
  692.             valParams,
  693.             csqcBase,
  694.             null,
  695.             wi.date(),
  696.             wi.factor(),
  697.             dblCleanPrice
  698.         );

  699.         double dblYieldToNextCall = bond.yieldFromPrice (
  700.             valParams,
  701.             csqcBase,
  702.             null,
  703.             NextCallDate (
  704.                 bond,
  705.                 iSpotDate
  706.             ),
  707.             NextCallFactor (
  708.                 bond,
  709.                 iSpotDate
  710.             ),
  711.             dblCleanPrice
  712.         );

  713.         double dblNominalYield = bond.yieldFromPrice (
  714.             valParams,
  715.             csqcBase,
  716.             null,
  717.             dblIssuePrice
  718.         );

  719.         double dblOASToMaturity = bond.oasFromPrice (
  720.             valParams,
  721.             csqcBase,
  722.             null,
  723.             dblCleanPrice
  724.         );

  725.         double dblOASToExercise = bond.oasFromPrice (
  726.             valParams,
  727.             csqcBase,
  728.             null,
  729.             wi.date(),
  730.             wi.factor(),
  731.             dblCleanPrice
  732.         );

  733.         double dblZSpreadToMaturity = bond.zSpreadFromPrice (
  734.             valParams,
  735.             csqcBase,
  736.             null,
  737.             dblCleanPrice
  738.         );

  739.         double dblZSpreadToExercise = bond.zSpreadFromPrice (
  740.             valParams,
  741.             csqcBase,
  742.             null,
  743.             wi.date(),
  744.             wi.factor(),
  745.             dblCleanPrice
  746.         );

  747.         double dblParZSpreadToExercise = bond.zSpreadFromPrice (
  748.             valParams,
  749.             csqcBase,
  750.             null,
  751.             wi.date(),
  752.             wi.factor(),
  753.             1.
  754.         );

  755.         double dblParOASToExercise = bond.oasFromPrice (
  756.             valParams,
  757.             csqcBase,
  758.             null,
  759.             wi.date(),
  760.             wi.factor(),
  761.             1.
  762.         );

  763.         double dblMacaulayDurationToMaturity = bond.macaulayDurationFromPrice (
  764.             valParams,
  765.             csqcBase,
  766.             null,
  767.             dblCleanPrice
  768.         );

  769.         double dblBondBasisToExercise = bond.bondBasisFromPrice (
  770.             valParams,
  771.             csqcBase,
  772.             null,
  773.             wi.date(),
  774.             wi.factor(),
  775.             dblCleanPrice
  776.         );

  777.         double dblModifiedDurationToWorst = (
  778.             dblCleanPrice - bond.priceFromBondBasis (
  779.                 valParams,
  780.                 csqcBumped01Up,
  781.                 null,
  782.                 wi.date(),
  783.                 wi.factor(),
  784.                 dblBondBasisToExercise
  785.             )
  786.         ) / dblCleanPrice;

  787.         double dblDV01 = 0.5 * (
  788.             bond.priceFromYield (
  789.                 valParams,
  790.                 csqcBase,
  791.                 null,
  792.                 wi.date(),
  793.                 wi.factor(),
  794.                 dblYieldToExercise - 0.0001 * dblSpreadBump
  795.             ) -
  796.             bond.priceFromYield (
  797.                 valParams,
  798.                 csqcBase,
  799.                 null,
  800.                 wi.date(),
  801.                 wi.factor(),
  802.                 dblYieldToExercise + 0.0001 * dblSpreadBump
  803.             )
  804.         ) / dblSpreadBump;

  805.         double dblEffectiveDuration = dblDV01 / dblCleanPrice;

  806.         double dblCreditBasisToExercise = bond.creditBasisFromPrice (
  807.             valParams,
  808.             csqcCreditBase,
  809.             null,
  810.             wi.date(),
  811.             wi.factor(),
  812.             dblCleanPrice
  813.         );

  814.         double dblParCreditBasisToExercise = bond.creditBasisFromPrice (
  815.             valParams,
  816.             csqcCreditBase,
  817.             null,
  818.             wi.date(),
  819.             wi.factor(),
  820.             1.
  821.         );

  822.         double dblEffectiveDurationAdj = 0.5 * (
  823.             bond.priceFromCreditBasis (
  824.                 valParams,
  825.                 csqcCreditBase,
  826.                 null,
  827.                 wi.date(),
  828.                 wi.factor(),
  829.                 dblCreditBasisToExercise - dblSpreadBump
  830.             ) -
  831.             bond.priceFromCreditBasis (
  832.                 valParams,
  833.                 csqcCreditBase,
  834.                 null,
  835.                 wi.date(),
  836.                 wi.factor(),
  837.                 dblCreditBasisToExercise + dblSpreadBump
  838.             )
  839.         ) / dblCleanPrice / dblSpreadBump;

  840.         double dblSpreadDuration = dblSpreadDurationMultiplier * (dblCleanPrice -
  841.             bond.priceFromZSpread (
  842.                 valParams,
  843.                 csqcBase,
  844.                 null,
  845.                 wi.date(),
  846.                 wi.factor(),
  847.                 dblZSpreadToExercise + 0.0001 * dblSpreadBump
  848.             )
  849.         ) / dblCleanPrice;

  850.         double dblCV01 = dblCleanPrice - bond.priceFromCreditBasis (
  851.             valParams,
  852.             csqcCreditBumped01Up,
  853.             null,
  854.             wi.date(),
  855.             wi.factor(),
  856.             dblCreditBasisToExercise
  857.         );

  858.         Map<String, Double> mapLIBORKRD = new HashMap<String, Double>();

  859.         Map<String, Double> mapLIBORKPRD = new HashMap<String, Double>();

  860.         Map<String, MergedDiscountForwardCurve> mapFundingCurve = TenorBumpedFundingCurve (
  861.             dtSpot,
  862.             strCurrency,
  863.             0.0001
  864.         );

  865.         for (Map.Entry<String, MergedDiscountForwardCurve> meFunding : mapFundingCurve.entrySet()) {
  866.             CurveSurfaceQuoteContainer csqcFunding = MarketParamsBuilder.Create (
  867.                 meFunding.getValue(),
  868.                 gc,
  869.                 null,
  870.                 null,
  871.                 null,
  872.                 null,
  873.                 null
  874.             );

  875.             mapLIBORKRD.put (
  876.                 meFunding.getKey(),
  877.                 (dblCleanPrice - bond.priceFromZSpread (
  878.                     valParams,
  879.                     csqcFunding,
  880.                     null,
  881.                     wi.date(),
  882.                     wi.factor(),
  883.                     dblZSpreadToExercise
  884.                 )) / dblCleanPrice
  885.             );

  886.             mapLIBORKPRD.put (
  887.                 meFunding.getKey(),
  888.                 1. - bond.priceFromZSpread (
  889.                     valParams,
  890.                     csqcFunding,
  891.                     null,
  892.                     wi.date(),
  893.                     wi.factor(),
  894.                     dblParZSpreadToExercise
  895.                 )
  896.             );
  897.         }

  898.         Map<String, Double> mapGovvieKRD = new HashMap<String, Double>();

  899.         Map<String, Double> mapGovvieKPRD = new HashMap<String, Double>();

  900.         Map<String, GovvieCurve> mapGovvieCurve = TenorBumpedGovvieCurve (
  901.             dtSpot,
  902.             strTreasuryCode,
  903.             0.0001,
  904.             adblGovvieYield
  905.         );

  906.         for (Map.Entry<String, GovvieCurve> meGovvie : mapGovvieCurve.entrySet()) {
  907.             CurveSurfaceQuoteContainer csqcGovvie = MarketParamsBuilder.Create (
  908.                 mdfcBase,
  909.                 meGovvie.getValue(),
  910.                 null,
  911.                 null,
  912.                 null,
  913.                 null,
  914.                 null
  915.             );

  916.             mapGovvieKRD.put (
  917.                 meGovvie.getKey(),
  918.                 (dblCleanPrice - bond.priceFromOAS (
  919.                     valParams,
  920.                     csqcGovvie,
  921.                     null,
  922.                     wi.date(),
  923.                     wi.factor(),
  924.                     dblOASToExercise
  925.                 )) / dblCleanPrice
  926.             );

  927.             mapGovvieKPRD.put (
  928.                 meGovvie.getKey(),
  929.                 1. - bond.priceFromOAS (
  930.                     valParams,
  931.                     csqcGovvie,
  932.                     null,
  933.                     wi.date(),
  934.                     wi.factor(),
  935.                     dblParOASToExercise
  936.                 )
  937.             );
  938.         }

  939.         Map<String, Double> mapCreditKRD = new HashMap<String, Double>();

  940.         Map<String, Double> mapCreditKPRD = new HashMap<String, Double>();

  941.         Map<String, CreditCurve> mapCreditCurve = TenorBumpedCreditCurve (
  942.             dtSpot,
  943.             strName,
  944.             mdfcBase,
  945.             1.
  946.         );

  947.         for (Map.Entry<String, CreditCurve> meCredit : mapCreditCurve.entrySet()) {
  948.             CurveSurfaceQuoteContainer csqcCredit = MarketParamsBuilder.Create (
  949.                 mdfcBase,
  950.                 gc,
  951.                 meCredit.getValue(),
  952.                 null,
  953.                 null,
  954.                 null,
  955.                 null
  956.             );

  957.             mapCreditKRD.put (
  958.                 meCredit.getKey(),
  959.                 (dblCleanPrice - bond.priceFromCreditBasis (
  960.                     valParams,
  961.                     csqcCredit,
  962.                     null,
  963.                     wi.date(),
  964.                     wi.factor(),
  965.                     dblCreditBasisToExercise
  966.                 )) / dblCleanPrice
  967.             );

  968.             mapCreditKPRD.put (
  969.                 meCredit.getKey(),
  970.                 1. - bond.priceFromCreditBasis (
  971.                     valParams,
  972.                     csqcCredit,
  973.                     null,
  974.                     wi.date(),
  975.                     wi.factor(),
  976.                     dblParCreditBasisToExercise
  977.                 )
  978.             );
  979.         }

  980.         double dblConvexityToExercise = bond.convexityFromPrice (
  981.             valParams,
  982.             csqcBase,
  983.             null,
  984.             wi.date(),
  985.             wi.factor(),
  986.             dblCleanPrice
  987.         );

  988.         double dblDiscountMarginToExercise = dblYieldToExercise - mdfcBase.libor (
  989.             dtSpot,
  990.             "1M"
  991.         );

  992.         double dblESpreadToExercise = bond.zSpreadFromPrice (
  993.             valParams,
  994.             MarketParamsBuilder.Create (
  995.                 LatentMarketStateBuilder.SmoothFundingCurve (
  996.                     dtSpot,
  997.                     strCurrency,
  998.                     astrDepositTenor,
  999.                     adblDepositQuote,
  1000.                     "ForwardRate",
  1001.                     adblFuturesQuote,
  1002.                     "ForwardRate",
  1003.                     null,
  1004.                     null,
  1005.                     "SwapRate"
  1006.                 ),
  1007.                 gc,
  1008.                 null,
  1009.                 null,
  1010.                 null,
  1011.                 null,
  1012.                 null
  1013.             ),
  1014.             null,
  1015.             wi.date(),
  1016.             wi.factor(),
  1017.             dblCleanPrice
  1018.         );

  1019.         double dblISpreadToExercise = bond.iSpreadFromPrice (
  1020.             valParams,
  1021.             csqcBase,
  1022.             null,
  1023.             wi.date(),
  1024.             wi.factor(),
  1025.             dblCleanPrice
  1026.         );

  1027.         double dblJSpreadToExercise = bond.jSpreadFromPrice (
  1028.             valParams,
  1029.             csqcBase,
  1030.             null,
  1031.             wi.date(),
  1032.             wi.factor(),
  1033.             dblCleanPrice
  1034.         );

  1035.         double dblWALToExercise = bond.weightedAverageLife (
  1036.             valParams,
  1037.             csqcBase,
  1038.             wi.date(),
  1039.             wi.factor()
  1040.         );

  1041.         double dblWALPrincipalOnlyToExercise = bond.weightedAverageLifePrincipalOnly (
  1042.             valParams,
  1043.             csqcBase,
  1044.             wi.date(),
  1045.             wi.factor()
  1046.         );

  1047.         double dblWALLossOnlyToExercise = bond.weightedAverageLifeLossOnly (
  1048.             valParams,
  1049.             csqcCreditBase,
  1050.             wi.date(),
  1051.             wi.factor()
  1052.         );

  1053.         double dblWALCouponOnlyToExercise = bond.weightedAverageLifeCouponOnly (
  1054.             valParams,
  1055.             csqcBase,
  1056.             wi.date(),
  1057.             wi.factor()
  1058.         );

  1059.         System.out.println();

  1060.         BondReplicator ar = BondReplicator.CorporateSenior (
  1061.             dblCleanPrice,
  1062.             dblIssuePrice,
  1063.             dblIssueAmount,
  1064.             dtSpot,
  1065.             astrDepositTenor,
  1066.             adblDepositQuote,
  1067.             adblFuturesQuote,
  1068.             astrFixFloatTenor,
  1069.             adblFixFloatQuote,
  1070.             dblSpreadBump,
  1071.             dblSpreadDurationMultiplier,
  1072.             strTreasuryCode,
  1073.             astrGovvieTenor,
  1074.             adblGovvieYield,
  1075.             astrCreditTenor,
  1076.             adblCreditQuote,
  1077.             dblFX,
  1078.             Double.NaN,
  1079.             iSettleLag,
  1080.             bond
  1081.         );

  1082.         BondReplicationRun arr = ar.generateRun();

  1083.         Map<String, NamedField> mapNF = arr.namedField();

  1084.         Map<String, NamedFieldMap> mapNFM = arr.namedFieldMap();

  1085.         NamedFieldMap nfmLIBORKRD = mapNFM.get ("LIBOR KRD");

  1086.         NamedFieldMap nfmLIBORKPRD = mapNFM.get ("LIBOR KPRD");

  1087.         NamedFieldMap nfmGovvieKRD = mapNFM.get ("Govvie KRD");

  1088.         NamedFieldMap nfmGovvieKPRD = mapNFM.get ("Govvie KPRD");

  1089.         NamedFieldMap nfmCreditKRD = mapNFM.get ("Credit KRD");

  1090.         NamedFieldMap nfmCreditKPRD = mapNFM.get ("Credit KPRD");

  1091.         System.out.println ("\t||------------------------------------------------||");

  1092.         System.out.println (
  1093.             "\t|| ID                      =>  " +
  1094.             strName + "-" + strCurrency
  1095.         );

  1096.         System.out.println (
  1097.             "\t|| Price                   => " +
  1098.             FormatUtil.FormatDouble (dblCleanPrice, 3, 3, 100.) + " | " +
  1099.             FormatUtil.FormatDouble (mapNF.get ("Price").value(), 3, 3, 100.)
  1100.         );

  1101.         System.out.println (
  1102.             "\t|| Market Value            => " +
  1103.             FormatUtil.FormatDouble (dblCleanPrice * dblIssueAmount, 7, 2, 1.) + " | " +
  1104.             FormatUtil.FormatDouble (mapNF.get ("Market Value").value(), 7, 2, 1.)
  1105.         );

  1106.         System.out.println (
  1107.             "\t|| Accrued                 => " +
  1108.             FormatUtil.FormatDouble (dblAccrued, 1, 4, 1.) + " | " +
  1109.             FormatUtil.FormatDouble (mapNF.get ("Accrued").value(), 1, 4, 1.)
  1110.         );

  1111.         System.out.println (
  1112.             "\t|| Accrued                 => " +
  1113.             FormatUtil.FormatDouble (dblAccrued * dblIssueAmount, 5, 2, 1.) + " | " +
  1114.             FormatUtil.FormatDouble (mapNF.get ("Accrued$").value(), 5, 2, 1.)
  1115.         );

  1116.         System.out.println (
  1117.             "\t|| Accrued Interest Factor => " +
  1118.             FormatUtil.FormatDouble (dblAccrued * dblFX, 1, 4, 1.) + " | " +
  1119.             FormatUtil.FormatDouble (mapNF.get ("Accrued Interest Factor").value(), 1, 4, 1.)
  1120.         );

  1121.         System.out.println (
  1122.             "\t|| Yield To Maturity       => " +
  1123.             FormatUtil.FormatDouble (dblYieldToMaturity, 1, 2, 100.) + "% | " +
  1124.             FormatUtil.FormatDouble (mapNF.get ("Yield To Maturity").value(), 1, 2, 100.) + "%"
  1125.         );

  1126.         System.out.println (
  1127.             "\t|| Yield To Maturity CBE   => " +
  1128.             FormatUtil.FormatDouble (dblBondEquivalentYieldToMaturity, 1, 2, 100.) + "% | " +
  1129.             FormatUtil.FormatDouble (mapNF.get ("Yield To Maturity CBE").value(), 1, 2, 100.) + "%"
  1130.         );

  1131.         System.out.println (
  1132.             "\t|| YTM fwdCpn              => " +
  1133.             FormatUtil.FormatDouble (dblFlatForwardRateYieldToMaturity, 1, 2, 100.) + "% | " +
  1134.             FormatUtil.FormatDouble (mapNF.get ("YTM fwdCpn").value(), 1, 2, 100.) + "%"
  1135.         );

  1136.         System.out.println (
  1137.             "\t|| Yield To Worst          => " +
  1138.             FormatUtil.FormatDouble (dblYieldToExercise, 1, 2, 100.) + "% | " +
  1139.             FormatUtil.FormatDouble (mapNF.get ("Yield To Worst").value(), 1, 2, 100.) + "%"
  1140.         );

  1141.         System.out.println (
  1142.             "\t|| YIELD TO CALL           => " +
  1143.             FormatUtil.FormatDouble (dblYieldToNextCall, 1, 2, 100.) + "% | " +
  1144.             FormatUtil.FormatDouble (mapNF.get ("YIELD TO CALL").value(), 1, 2, 100.) + "%"
  1145.         );

  1146.         System.out.println (
  1147.             "\t|| Nominal Yield           => " +
  1148.             FormatUtil.FormatDouble (dblNominalYield, 1, 2, 100.) + "% | " +
  1149.             FormatUtil.FormatDouble (mapNF.get ("Nominal Yield").value(), 1, 2, 100.) + "%"
  1150.         );

  1151.         System.out.println (
  1152.             "\t|| Z_Spread                => " +
  1153.             FormatUtil.FormatDouble (dblOASToMaturity, 3, 1, 10000.) + " | " +
  1154.             FormatUtil.FormatDouble (mapNF.get ("Z_Spread").value(), 3, 1, 10000.)
  1155.         );

  1156.         System.out.println (
  1157.             "\t|| Z_Vol_OAS               => " +
  1158.             FormatUtil.FormatDouble (dblZSpreadToMaturity, 3, 1, 10000.) + " | " +
  1159.             FormatUtil.FormatDouble (mapNF.get ("Z_Vol_OAS").value(), 3, 1, 10000.)
  1160.         );

  1161.         System.out.println (
  1162.             "\t|| OAS                     => " +
  1163.             FormatUtil.FormatDouble (dblZSpreadToExercise, 3, 1, 10000.) + " | " +
  1164.             FormatUtil.FormatDouble (mapNF.get ("OAS").value(), 3, 1, 10000.)
  1165.         );

  1166.         System.out.println (
  1167.             "\t|| TSY OAS                 => " +
  1168.             FormatUtil.FormatDouble (dblOASToExercise, 3, 1, 10000.) + " | " +
  1169.             FormatUtil.FormatDouble (mapNF.get ("TSY OAS").value(), 3, 1, 10000.)
  1170.         );

  1171.         System.out.println (
  1172.             "\t|| MOD DUR                 => " +
  1173.             FormatUtil.FormatDouble (dblModifiedDurationToMaturity, 1, 3, 10000.) + " | " +
  1174.             FormatUtil.FormatDouble (mapNF.get ("MOD DUR").value(), 1, 3, 10000.)
  1175.         );

  1176.         System.out.println (
  1177.             "\t|| MACAULAY DURATION       => " +
  1178.             FormatUtil.FormatDouble (dblMacaulayDurationToMaturity, 1, 3, 1.) + " | " +
  1179.             FormatUtil.FormatDouble (mapNF.get ("MACAULAY DURATION").value(), 1, 3, 1.)
  1180.         );

  1181.         System.out.println (
  1182.             "\t|| MOD DUR TO WORST        => " +
  1183.             FormatUtil.FormatDouble (dblModifiedDurationToWorst, 1, 3, 10000.) + " | " +
  1184.             FormatUtil.FormatDouble (mapNF.get ("MOD DUR TO WORST").value(), 1, 3, 10000.)
  1185.         );

  1186.         System.out.println (
  1187.             "\t|| EFFECTIVE DURATION      => " +
  1188.             FormatUtil.FormatDouble (dblEffectiveDuration, 1, 3, 10000.) + " | " +
  1189.             FormatUtil.FormatDouble (mapNF.get ("EFFECTIVE DURATION").value(), 1, 3, 10000.)
  1190.         );

  1191.         System.out.println (
  1192.             "\t|| EFFECTIVE DURATION ADJ  => " +
  1193.             FormatUtil.FormatDouble (dblEffectiveDurationAdj, 1, 3, 10000.) + " | " +
  1194.             FormatUtil.FormatDouble (mapNF.get ("EFFECTIVE DURATION ADJ").value(), 1, 3, 10000.)
  1195.         );

  1196.         System.out.println (
  1197.             "\t|| OAD MULT                => " +
  1198.             FormatUtil.FormatDouble (dblEffectiveDurationAdj / dblEffectiveDuration, 1, 3, 1.) + " | " +
  1199.             FormatUtil.FormatDouble (mapNF.get ("OAD MULT").value(), 1, 3, 1.)
  1200.         );

  1201.         System.out.println (
  1202.             "\t|| Spread Dur              => " +
  1203.             FormatUtil.FormatDouble (dblSpreadDuration, 1, 3, 100.) + " | " +
  1204.             FormatUtil.FormatDouble (mapNF.get ("Spread Dur").value(), 1, 3, 100.)
  1205.         );

  1206.         System.out.println (
  1207.             "\t|| Spread Dur              => " +
  1208.             FormatUtil.FormatDouble (dblSpreadDuration * dblIssueAmount, 1, 3, 1.) + " | " +
  1209.             FormatUtil.FormatDouble (mapNF.get ("Spread Dur $").value(), 1, 3, 1.)
  1210.         );

  1211.         System.out.println (
  1212.             "\t|| DV01                    => " +
  1213.             FormatUtil.FormatDouble (dblDV01, 1, 3, 10000.) + " | " +
  1214.             FormatUtil.FormatDouble (mapNF.get ("DV01").value(), 1, 3, 10000.)
  1215.         );

  1216.         System.out.println (
  1217.             "\t|| CV01                    => " +
  1218.             FormatUtil.FormatDouble (dblCV01, 1, 3, 10000.) + " | " +
  1219.             FormatUtil.FormatDouble (mapNF.get ("CV01").value(), 1, 3, 10000.)
  1220.         );

  1221.         System.out.println (
  1222.             "\t|| Convexity               => " +
  1223.             FormatUtil.FormatDouble (dblConvexityToExercise, 1, 3, 1000000.) + " | " +
  1224.             FormatUtil.FormatDouble (mapNF.get ("Convexity").value(), 1, 3, 1000000.)
  1225.         );

  1226.         System.out.println (
  1227.             "\t|| Modified Convexity      => " +
  1228.             FormatUtil.FormatDouble (dblConvexityToExercise, 1, 3, 1000000.) + " | " +
  1229.             FormatUtil.FormatDouble (mapNF.get ("Modified Convexity").value(), 1, 3, 1000000.)
  1230.         );

  1231.         System.out.println (
  1232.             "\t|| DISCOUNT MARGIN         => " +
  1233.             FormatUtil.FormatDouble (dblDiscountMarginToExercise, 3, 1, 10000.) + " | " +
  1234.             FormatUtil.FormatDouble (mapNF.get ("DISCOUNT MARGIN").value(), 3, 1, 10000.)
  1235.         );

  1236.         System.out.println (
  1237.             "\t|| E-Spread                => " +
  1238.             FormatUtil.FormatDouble (dblESpreadToExercise, 3, 1, 10000.) + " | " +
  1239.             FormatUtil.FormatDouble (mapNF.get ("E-Spread").value(), 3, 1, 10000.)
  1240.         );

  1241.         System.out.println (
  1242.             "\t|| I-Spread                => " +
  1243.             FormatUtil.FormatDouble (dblISpreadToExercise, 3, 1, 10000.) + " | " +
  1244.             FormatUtil.FormatDouble (mapNF.get ("I-Spread").value(), 3, 1, 10000.)
  1245.         );

  1246.         System.out.println (
  1247.             "\t|| J-Spread                => " +
  1248.             FormatUtil.FormatDouble (dblJSpreadToExercise, 3, 1, 10000.) + " | " +
  1249.             FormatUtil.FormatDouble (mapNF.get ("J-Spread").value(), 3, 1, 10000.)
  1250.         );

  1251.         System.out.println (
  1252.             "\t|| WAL To Worst            => " +
  1253.             FormatUtil.FormatDouble (dblWALToExercise, 1, 3, 1.) + " | " +
  1254.             FormatUtil.FormatDouble (mapNF.get ("WAL To Worst").value(), 1, 3, 1.)
  1255.         );

  1256.         System.out.println (
  1257.             "\t|| WAL                     => " +
  1258.             FormatUtil.FormatDouble (dblWALPrincipalOnlyToExercise, 1, 3, 1.) + " | " +
  1259.             FormatUtil.FormatDouble (mapNF.get ("WAL").value(), 1, 3, 1.)
  1260.         );

  1261.         System.out.println (
  1262.             "\t|| WAL2                    => " +
  1263.             FormatUtil.FormatDouble (dblWALLossOnlyToExercise, 1, 3, 1.) + " | " +
  1264.             FormatUtil.FormatDouble (mapNF.get ("WAL2").value(), 1, 3, 1.)
  1265.         );

  1266.         System.out.println (
  1267.             "\t|| WAL3                    => " +
  1268.             FormatUtil.FormatDouble (dblWALCouponOnlyToExercise, 1, 3, 1.) + " | " +
  1269.             FormatUtil.FormatDouble (mapNF.get ("WAL3").value(), 1, 3, 1.)
  1270.         );

  1271.         System.out.println (
  1272.             "\t|| WAL4                    => " +
  1273.             FormatUtil.FormatDouble (dblWALToExercise, 1, 3, 1.) + " | " +
  1274.             FormatUtil.FormatDouble (mapNF.get ("WAL4").value(), 1, 3, 1.)
  1275.         );

  1276.         System.out.println ("\t||------------------------------------------------||");

  1277.         for (Map.Entry<String, Double> meLIBORKRD : mapLIBORKRD.entrySet())
  1278.             System.out.println (
  1279.                 "\t|| LIBOR KRD " + meLIBORKRD.getKey() + " => " +
  1280.                 FormatUtil.FormatDouble (meLIBORKRD.getValue(), 1, 3, 10000.) + " | " +
  1281.                 FormatUtil.FormatDouble (nfmLIBORKRD.value().get (meLIBORKRD.getKey()), 1, 3, 10000.)
  1282.             );

  1283.         System.out.println ("\t||------------------------------------------------||");

  1284.         for (Map.Entry<String, Double> meLIBORKPRD : mapLIBORKPRD.entrySet())
  1285.             System.out.println (
  1286.                 "\t|| LIBOR KPRD " + meLIBORKPRD.getKey() + " => " +
  1287.                 FormatUtil.FormatDouble (meLIBORKPRD.getValue(), 1, 3, 10000.) + " | " +
  1288.                 FormatUtil.FormatDouble (nfmLIBORKPRD.value().get (meLIBORKPRD.getKey()), 1, 3, 10000.)
  1289.             );

  1290.         System.out.println ("\t||------------------------------------------------||");

  1291.         for (Map.Entry<String, Double> meGovvieKRD : mapGovvieKRD.entrySet())
  1292.             System.out.println (
  1293.                 "\t|| Govvie KRD " + meGovvieKRD.getKey() + " => " +
  1294.                 FormatUtil.FormatDouble (meGovvieKRD.getValue(), 1, 3, 10000.) + " | " +
  1295.                 FormatUtil.FormatDouble (nfmGovvieKRD.value().get (meGovvieKRD.getKey()), 1, 3, 10000.)
  1296.             );

  1297.         System.out.println ("\t||------------------------------------------------||");

  1298.         for (Map.Entry<String, Double> meGovvieKPRD : mapGovvieKPRD.entrySet())
  1299.             System.out.println (
  1300.                 "\t|| Govvie KPRD " + meGovvieKPRD.getKey() + " => " +
  1301.                 FormatUtil.FormatDouble (meGovvieKPRD.getValue(), 1, 3, 10000.) + " | " +
  1302.                 FormatUtil.FormatDouble (nfmGovvieKPRD.value().get (meGovvieKPRD.getKey()), 1, 3, 10000.)
  1303.             );

  1304.         System.out.println ("\t||------------------------------------------------||");

  1305.         for (Map.Entry<String, Double> meCreditKRD : mapCreditKRD.entrySet())
  1306.             System.out.println (
  1307.                 "\t|| Credit KRD " + meCreditKRD.getKey() + " => " +
  1308.                 FormatUtil.FormatDouble (meCreditKRD.getValue(), 1, 3, 10000.) + " | " +
  1309.                 FormatUtil.FormatDouble (nfmCreditKRD.value().get (meCreditKRD.getKey()), 1, 3, 10000.)
  1310.             );

  1311.         System.out.println ("\t||------------------------------------------------||");

  1312.         for (Map.Entry<String, Double> meCreditKPRD : mapCreditKPRD.entrySet())
  1313.             System.out.println (
  1314.                 "\t|| Credit KPRD " + meCreditKPRD.getKey() + " => " +
  1315.                 FormatUtil.FormatDouble (meCreditKPRD.getValue(), 1, 3, 10000.) + " | " +
  1316.                 FormatUtil.FormatDouble (nfmCreditKPRD.value().get (meCreditKPRD.getKey()), 1, 3, 10000.)
  1317.             );

  1318.         System.out.println ("\t||------------------------------------------------||");

  1319.         EnvManager.TerminateEnv();
  1320.     }
  1321. }