PathVertexExerciseMetrics.java

  1. package org.drip.sample.govviemc;

  2. import org.drip.analytics.date.*;
  3. import org.drip.measure.crng.RandomNumberGenerator;
  4. import org.drip.measure.discrete.CorrelatedPathVertexDimension;
  5. import org.drip.measure.dynamics.DiffusionEvaluatorLogarithmic;
  6. import org.drip.measure.process.DiffusionEvolver;
  7. import org.drip.measure.statistics.UnivariateDiscreteThin;
  8. import org.drip.numerical.common.FormatUtil;
  9. import org.drip.param.creator.MarketParamsBuilder;
  10. import org.drip.param.market.CurveSurfaceQuoteContainer;
  11. import org.drip.param.valuation.ValuationParams;
  12. import org.drip.product.creator.BondBuilder;
  13. import org.drip.product.credit.BondComponent;
  14. import org.drip.product.params.EmbeddedOptionSchedule;
  15. import org.drip.service.env.EnvManager;
  16. import org.drip.service.template.LatentMarketStateBuilder;
  17. import org.drip.state.discount.MergedDiscountForwardCurve;
  18. import org.drip.state.govvie.GovvieCurve;
  19. import org.drip.state.sequence.*;

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

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

  83. /**
  84.  * <i>PathVertexExerciseMetrics</i> demonstrates the Simulations of the Per-Path Callable Bond OAS Based
  85.  * Exercise Metrics.
  86.  *  
  87.  * <br><br>
  88.  *  <ul>
  89.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AnalyticsCore.md">Analytics Core Module</a></li>
  90.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics Library</a></li>
  91.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">Sample</a></li>
  92.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/govviemc/README.md">Govvie Curve Monte Carlo Runs</a></li>
  93.  *  </ul>
  94.  * <br><br>
  95.  *
  96.  * @author Lakshmi Krishnamurthy
  97.  */

  98. public class PathVertexExerciseMetrics {

  99.     private static final MergedDiscountForwardCurve FundingCurve (
  100.         final JulianDate dtSpot,
  101.         final String strCurrency,
  102.         final double dblBump)
  103.         throws Exception
  104.     {
  105.         String[] astrDepositMaturityTenor = new String[] {
  106.             "2D"
  107.         };

  108.         double[] adblDepositQuote = new double[] {
  109.             0.0111956 + dblBump // 2D
  110.         };

  111.         double[] adblFuturesQuote = new double[] {
  112.             0.011375 + dblBump, // 98.8625
  113.             0.013350 + dblBump, // 98.6650
  114.             0.014800 + dblBump, // 98.5200
  115.             0.016450 + dblBump, // 98.3550
  116.             0.017850 + dblBump, // 98.2150
  117.             0.019300 + dblBump  // 98.0700
  118.         };

  119.         String[] astrFixFloatMaturityTenor = new String[] {
  120.             "02Y",
  121.             "03Y",
  122.             "04Y",
  123.             "05Y",
  124.             "06Y",
  125.             "07Y",
  126.             "08Y",
  127.             "09Y",
  128.             "10Y",
  129.             "11Y",
  130.             "12Y",
  131.             "15Y",
  132.             "20Y",
  133.             "25Y",
  134.             "30Y",
  135.             "40Y",
  136.             "50Y"
  137.         };

  138.         double[] adblFixFloatQuote = new double[] {
  139.             0.017029 + dblBump, //  2Y
  140.             0.019354 + dblBump, //  3Y
  141.             0.021044 + dblBump, //  4Y
  142.             0.022291 + dblBump, //  5Y
  143.             0.023240 + dblBump, //  6Y
  144.             0.024025 + dblBump, //  7Y
  145.             0.024683 + dblBump, //  8Y
  146.             0.025243 + dblBump, //  9Y
  147.             0.025720 + dblBump, // 10Y
  148.             0.026130 + dblBump, // 11Y
  149.             0.026495 + dblBump, // 12Y
  150.             0.027230 + dblBump, // 15Y
  151.             0.027855 + dblBump, // 20Y
  152.             0.028025 + dblBump, // 25Y
  153.             0.028028 + dblBump, // 30Y
  154.             0.027902 + dblBump, // 40Y
  155.             0.027655 + dblBump  // 50Y
  156.         };

  157.         return LatentMarketStateBuilder.SmoothFundingCurve (
  158.             dtSpot,
  159.             strCurrency,
  160.             astrDepositMaturityTenor,
  161.             adblDepositQuote,
  162.             "ForwardRate",
  163.             adblFuturesQuote,
  164.             "ForwardRate",
  165.             astrFixFloatMaturityTenor,
  166.             adblFixFloatQuote,
  167.             "SwapRate"
  168.         );
  169.     }

  170.     private static final PathVertexGovvie ScenarioGovvieCurves (
  171.         final JulianDate dtSpot,
  172.         final int iNumPath,
  173.         final int iNumVertex)
  174.         throws Exception
  175.     {
  176.         double dblVolatility = 0.10;
  177.         String strTreasuryCode = "UST";

  178.         String[] astrTenor = new String[] {
  179.             "01Y",
  180.             "02Y",
  181.             "03Y",
  182.             "05Y",
  183.             "07Y",
  184.             "10Y",
  185.             "20Y",
  186.             "30Y"
  187.         };

  188.         double[] adblTreasuryCoupon = new double[] {
  189.             0.0100,
  190.             0.0100,
  191.             0.0125,
  192.             0.0150,
  193.             0.0200,
  194.             0.0225,
  195.             0.0250,
  196.             0.0300
  197.         };

  198.         double[] adblTreasuryYield = new double[] {
  199.             0.0083, //  1Y
  200.             0.0122, //  2Y
  201.             0.0149, //  3Y
  202.             0.0193, //  5Y
  203.             0.0227, //  7Y
  204.             0.0248, // 10Y
  205.             0.0280, // 20Y
  206.             0.0308  // 30Y
  207.         };

  208.         int iNumDimension = astrTenor.length;
  209.         double[][] aadblCorrelation = new double[iNumDimension][iNumDimension];

  210.         for (int i = 0; i < iNumDimension; ++i) {
  211.             for (int j = 0; j < iNumDimension; ++j)
  212.                 aadblCorrelation[i][j] = i == j ? 1. : 0.;
  213.         }

  214.         GovvieBuilderSettings gbs = new GovvieBuilderSettings (
  215.             dtSpot,
  216.             strTreasuryCode,
  217.             astrTenor,
  218.             adblTreasuryCoupon,
  219.             adblTreasuryYield
  220.         );

  221.         return PathVertexGovvie.Standard (
  222.             gbs,
  223.             new CorrelatedPathVertexDimension (
  224.                 new RandomNumberGenerator(),
  225.                 aadblCorrelation,
  226.                 iNumVertex,
  227.                 iNumPath,
  228.                 false,
  229.                 null
  230.             ),
  231.             new DiffusionEvolver (
  232.                 DiffusionEvaluatorLogarithmic.Standard (
  233.                     0.,
  234.                     dblVolatility
  235.                 )
  236.             )
  237.         );
  238.     }

  239.     private static final BondComponent Callable (
  240.         final EmbeddedOptionSchedule eos)
  241.         throws Exception
  242.     {
  243.         JulianDate dtEffective = DateUtil.CreateFromYMD (
  244.             2009,
  245.             12,
  246.             3
  247.         );

  248.         JulianDate dtMaturity  = DateUtil.CreateFromYMD (
  249.             2039,
  250.             12,
  251.             1
  252.         );

  253.         double dblCoupon = 0.06558;
  254.         int iFreq = 2;
  255.         String strCUSIP = "033177XV3";
  256.         String strDayCount = "30/360";

  257.         BondComponent bond = BondBuilder.CreateSimpleFixed (
  258.             strCUSIP,
  259.             "USD",
  260.             "",
  261.             dblCoupon,
  262.             iFreq,
  263.             strDayCount,
  264.             dtEffective,
  265.             dtMaturity,
  266.             null,
  267.             null
  268.         );

  269.         bond.setEmbeddedCallSchedule (eos);

  270.         return bond;
  271.     }

  272.     public static final void main (
  273.         final String[] astrArgs)
  274.         throws Exception
  275.     {
  276.         EnvManager.InitEnv ("");

  277.         JulianDate dtSpot = DateUtil.CreateFromYMD (
  278.             2017,
  279.             DateUtil.MARCH,
  280.             24
  281.         );

  282.         int iNumPath = 50;
  283.         double dblCleanPrice = 1.08641;
  284.         int[] aiExerciseDate = new int[] {
  285.             DateUtil.CreateFromYMD (2019, 12,  1).julian(),
  286.             DateUtil.CreateFromYMD (2020, 12,  1).julian(),
  287.             DateUtil.CreateFromYMD (2021, 12,  1).julian(),
  288.             DateUtil.CreateFromYMD (2022, 12,  1).julian(),
  289.             DateUtil.CreateFromYMD (2023, 12,  1).julian(),
  290.             DateUtil.CreateFromYMD (2024, 12,  1).julian(),
  291.             DateUtil.CreateFromYMD (2025, 12,  1).julian(),
  292.             DateUtil.CreateFromYMD (2026, 12,  1).julian(),
  293.             DateUtil.CreateFromYMD (2027, 12,  1).julian(),
  294.             DateUtil.CreateFromYMD (2028, 12,  1).julian(),
  295.             DateUtil.CreateFromYMD (2029, 12,  1).julian(),
  296.             DateUtil.CreateFromYMD (2030, 12,  1).julian(),
  297.             DateUtil.CreateFromYMD (2031, 12,  1).julian(),
  298.             DateUtil.CreateFromYMD (2032, 12,  1).julian(),
  299.             DateUtil.CreateFromYMD (2033, 12,  1).julian(),
  300.             DateUtil.CreateFromYMD (2034, 12,  1).julian(),
  301.             DateUtil.CreateFromYMD (2035, 12,  1).julian(),
  302.             DateUtil.CreateFromYMD (2036, 12,  1).julian(),
  303.             DateUtil.CreateFromYMD (2037, 12,  1).julian(),
  304.             DateUtil.CreateFromYMD (2038, 12,  1).julian(),
  305.         };
  306.         double[] adblExercisePrice = new double[] {
  307.             1.,
  308.             1.,
  309.             1.,
  310.             1.,
  311.             1.,
  312.             1.,
  313.             1.,
  314.             1.,
  315.             1.,
  316.             1.,
  317.             1.,
  318.             1.,
  319.             1.,
  320.             1.,
  321.             1.,
  322.             1.,
  323.             1.,
  324.             1.,
  325.             1.,
  326.             1.,
  327.         };

  328.         int iNumVertex = aiExerciseDate.length;
  329.         double[] adblOptimalExercisePV = new double[iNumPath];
  330.         int[] aiOptimalExerciseVertexIndex = new int[iNumPath];
  331.         double[] adblOptimalExerciseOAS = new double[iNumPath];
  332.         double[] adblOptimalExercisePrice = new double[iNumPath];
  333.         double[] adblOptimalExerciseOASGap = new double[iNumPath];
  334.         double[] adblOptimalExerciseDuration = new double[iNumPath];
  335.         double[] adblOptimalExerciseConvexity = new double[iNumPath];
  336.         JulianDate[] adtOptimalExerciseDate = new JulianDate[iNumPath];
  337.         double[][] aadblForwardPrice = new double[iNumPath][iNumVertex];
  338.         ValuationParams[] aValParamsEvent = new ValuationParams[iNumVertex];

  339.         BondComponent bond = Callable (
  340.             new EmbeddedOptionSchedule (
  341.                 aiExerciseDate,
  342.                 adblExercisePrice,
  343.                 false,
  344.                 30,
  345.                 false,
  346.                 Double.NaN,
  347.                 "",
  348.                 Double.NaN
  349.             )
  350.         );

  351.         PathVertexGovvie mcrg = ScenarioGovvieCurves (
  352.             dtSpot,
  353.             iNumPath,
  354.             iNumVertex
  355.         );

  356.         GovvieCurve[][] aaGCPathEvent = mcrg.pathVertex (aiExerciseDate);

  357.         MergedDiscountForwardCurve mdfc = FundingCurve (
  358.             dtSpot,
  359.             "USD",
  360.             0.
  361.         );

  362.         CurveSurfaceQuoteContainer csqcSpot = MarketParamsBuilder.Create (
  363.             mdfc,
  364.             mcrg.govvieBuilderSettings().groundState(),
  365.             null,
  366.             null,
  367.             null,
  368.             null,
  369.             null
  370.         );

  371.         ValuationParams valParamsSpot = ValuationParams.Spot (dtSpot.julian());

  372.         double dblOASSpot = bond.oasFromPrice (
  373.             valParamsSpot,
  374.             csqcSpot,
  375.             null,
  376.             dblCleanPrice
  377.         );

  378.         for (int iVertex = 0; iVertex < iNumVertex; ++iVertex)
  379.             aValParamsEvent[iVertex] = ValuationParams.Spot (aiExerciseDate[iVertex]);

  380.         for (int iPath = 0; iPath < iNumPath; ++iPath) {
  381.             for (int iVertex = 0; iVertex < iNumVertex; ++iVertex) {
  382.                 CurveSurfaceQuoteContainer csqcEvent = MarketParamsBuilder.Create (
  383.                     mdfc,
  384.                     aaGCPathEvent[iPath][iVertex],
  385.                     null,
  386.                     null,
  387.                     null,
  388.                     null,
  389.                     null
  390.                 );

  391.                 aadblForwardPrice[iPath][iVertex] = bond.priceFromOAS (
  392.                     aValParamsEvent[iVertex],
  393.                     csqcEvent,
  394.                     null,
  395.                     dblOASSpot
  396.                 );
  397.             }
  398.         }

  399.         for (int iPath = 0; iPath < iNumPath; ++iPath) {
  400.             adblOptimalExercisePV[iPath] = 0.;
  401.             adblOptimalExercisePrice[iPath] = 1.;
  402.             aiOptimalExerciseVertexIndex[0] = iNumVertex - 1;

  403.             adtOptimalExerciseDate[iPath] = bond.maturityDate();

  404.             for (int iVertex = 0; iVertex < iNumVertex; ++iVertex) {
  405.                 double dblExercisePV = (aadblForwardPrice[iPath][iVertex] - adblExercisePrice[iVertex])
  406.                     * mdfc.df (aiExerciseDate[iVertex]);

  407.                 if (dblExercisePV > adblOptimalExercisePV[iPath]) {
  408.                     adtOptimalExerciseDate[iPath] = new JulianDate (aiExerciseDate[iVertex]);

  409.                     adblOptimalExercisePrice[iPath] = adblExercisePrice[iVertex];
  410.                     aiOptimalExerciseVertexIndex[iPath] = iVertex;
  411.                     adblOptimalExercisePV[iPath] = dblExercisePV;
  412.                 }
  413.             }
  414.         }

  415.         System.out.println ("\n");

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

  417.         System.out.println ("\t||                        PATH-WISE EXERCISE METRICS                         ||");

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

  419.         System.out.println ("\t||    L -> R:                                                                ||");

  420.         System.out.println ("\t||        Path Number                                                        ||");

  421.         System.out.println ("\t||        Optimal Exercise Index                                             ||");

  422.         System.out.println ("\t||        Optimal Exercise Date                                              ||");

  423.         System.out.println ("\t||        Optimal Exercise Price                                             ||");

  424.         System.out.println ("\t||        Optimal Exercise Value                                             ||");

  425.         System.out.println ("\t||        Optimal Exercise OAS                                               ||");

  426.         System.out.println ("\t||        Optimal Exercise OAS Gap                                           ||");

  427.         System.out.println ("\t||        Optimal Exercise Duration                                          ||");

  428.         System.out.println ("\t||        Optimal Exercise Convexity                                         ||");

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

  430.         for (int iPath = 0; iPath < iNumPath; ++iPath) {
  431.             int iOptimalExerciseDate = adtOptimalExerciseDate[iPath].julian();

  432.             adblOptimalExerciseOAS[iPath] = bond.oasFromPrice (
  433.                 valParamsSpot,
  434.                 csqcSpot,
  435.                 null,
  436.                 iOptimalExerciseDate,
  437.                 adblOptimalExercisePrice[iPath],
  438.                 dblCleanPrice
  439.             );

  440.             adblOptimalExerciseDuration[iPath] = bond.modifiedDurationFromPrice (
  441.                 valParamsSpot,
  442.                 csqcSpot,
  443.                 null,
  444.                 iOptimalExerciseDate,
  445.                 adblOptimalExercisePrice[iPath],
  446.                 dblCleanPrice
  447.             );

  448.             adblOptimalExerciseConvexity[iPath] = bond.convexityFromPrice (
  449.                 valParamsSpot,
  450.                 csqcSpot,
  451.                 null,
  452.                 iOptimalExerciseDate,
  453.                 adblOptimalExercisePrice[iPath],
  454.                 dblCleanPrice
  455.             );

  456.             adblOptimalExerciseOASGap[iPath] = adblOptimalExerciseOAS[iPath] - dblOASSpot;

  457.             System.out.println (
  458.                 "\t|| " +
  459.                 FormatUtil.FormatDouble (iPath, 2, 0, 1.) + " => " +
  460.                 FormatUtil.FormatDouble (aiOptimalExerciseVertexIndex[iPath], 2, 0, 1.) + " | " +
  461.                 adtOptimalExerciseDate[iPath] + " | " +
  462.                 FormatUtil.FormatDouble (adblOptimalExercisePrice[iPath], 3, 2, 100.) + " | " +
  463.                 FormatUtil.FormatDouble (adblOptimalExercisePV[iPath], 2, 1, 100.) + " | " +
  464.                 FormatUtil.FormatDouble (adblOptimalExerciseOAS[iPath], 3, 0, 10000.) + " | " +
  465.                 FormatUtil.FormatDouble (adblOptimalExerciseOASGap[iPath], 3, 0, 10000.) + " | " +
  466.                 FormatUtil.FormatDouble (adblOptimalExerciseDuration[iPath], 2, 2, 10000.)  + " | " +
  467.                 FormatUtil.FormatDouble (adblOptimalExerciseConvexity[iPath], 1, 2, 1000000.) + " ||"
  468.             );
  469.         }

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

  471.         System.out.println();

  472.         UnivariateDiscreteThin udtOptimalExercisePrice = new UnivariateDiscreteThin (adblOptimalExercisePrice);

  473.         UnivariateDiscreteThin udtOptimalExercisePV = new UnivariateDiscreteThin (adblOptimalExercisePV);

  474.         UnivariateDiscreteThin udtOptimalExerciseOAS = new UnivariateDiscreteThin (adblOptimalExerciseOAS);

  475.         UnivariateDiscreteThin udtOptimalExerciseOASGap = new UnivariateDiscreteThin (adblOptimalExerciseOASGap);

  476.         UnivariateDiscreteThin udtOptimalExerciseDuration = new UnivariateDiscreteThin (adblOptimalExerciseDuration);

  477.         UnivariateDiscreteThin udtOptimalExerciseConvexity = new UnivariateDiscreteThin (adblOptimalExerciseConvexity);

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

  479.         System.out.println ("\t||        Optimal Exercise Price                               ||");

  480.         System.out.println ("\t||        Optimal Exercise Value                               ||");

  481.         System.out.println ("\t||        Optimal Exercise OAS                                 ||");

  482.         System.out.println ("\t||        Optimal Exercise OAS Gap                             ||");

  483.         System.out.println ("\t||        Optimal Exercise Duration                            ||");

  484.         System.out.println ("\t||        Optimal Exercise Convexity                           ||");

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

  486.         System.out.println ("\t|| AVERAGE => " +
  487.             FormatUtil.FormatDouble (udtOptimalExercisePrice.average(), 3, 2, 100.) + " | " +
  488.             FormatUtil.FormatDouble (udtOptimalExercisePV.average(), 2, 1, 100.) + " | " +
  489.             FormatUtil.FormatDouble (udtOptimalExerciseOAS.average(), 3, 1, 10000.) + " | " +
  490.             FormatUtil.FormatDouble (udtOptimalExerciseOASGap.average(), 3, 0, 10000.) + " | " +
  491.             FormatUtil.FormatDouble (udtOptimalExerciseDuration.average(), 2, 2, 10000.) + " | " +
  492.             FormatUtil.FormatDouble (udtOptimalExerciseConvexity.average(), 1, 2, 1000000.) + " ||"
  493.         );

  494.         System.out.println ("\t||  ERROR  => " +
  495.             FormatUtil.FormatDouble (udtOptimalExercisePrice.error(), 3, 2, 100.) + " | " +
  496.             FormatUtil.FormatDouble (udtOptimalExercisePV.error(), 2, 1, 100.) + " | " +
  497.             FormatUtil.FormatDouble (udtOptimalExerciseOAS.error(), 3, 1, 10000.) + " | " +
  498.             FormatUtil.FormatDouble (udtOptimalExerciseOASGap.error(), 3, 0, 10000.) + " | " +
  499.             FormatUtil.FormatDouble (udtOptimalExerciseDuration.error(), 2, 2, 10000.) + " | " +
  500.             FormatUtil.FormatDouble (udtOptimalExerciseConvexity.error(), 1, 2, 1000000.) + " ||"
  501.         );

  502.         System.out.println ("\t|| MAXIMUM => " +
  503.             FormatUtil.FormatDouble (udtOptimalExercisePrice.maximum(), 3, 2, 100.) + " | " +
  504.             FormatUtil.FormatDouble (udtOptimalExercisePV.maximum(), 2, 1, 100.) + " | " +
  505.             FormatUtil.FormatDouble (udtOptimalExerciseOAS.maximum(), 3, 1, 10000.) + " | " +
  506.             FormatUtil.FormatDouble (udtOptimalExerciseOASGap.maximum(), 3, 0, 10000.) + " | " +
  507.             FormatUtil.FormatDouble (udtOptimalExerciseDuration.maximum(), 2, 2, 10000.) + " | " +
  508.             FormatUtil.FormatDouble (udtOptimalExerciseConvexity.maximum(), 1, 2, 1000000.) + " ||"
  509.         );

  510.         System.out.println ("\t|| MINIMUM => " +
  511.             FormatUtil.FormatDouble (udtOptimalExercisePrice.minimum(), 3, 2, 100.) + " | " +
  512.             FormatUtil.FormatDouble (udtOptimalExercisePV.minimum(), 2, 1, 100.) + " | " +
  513.             FormatUtil.FormatDouble (udtOptimalExerciseOAS.minimum(), 3, 1, 10000.) + " | " +
  514.             FormatUtil.FormatDouble (udtOptimalExerciseOASGap.minimum(), 3, 0, 10000.) + " | " +
  515.             FormatUtil.FormatDouble (udtOptimalExerciseDuration.minimum(), 2, 2, 10000.) + " | " +
  516.             FormatUtil.FormatDouble (udtOptimalExerciseConvexity.minimum(), 1, 2, 1000000.) + " ||"
  517.         );

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

  519.         System.out.println();

  520.         EnvManager.TerminateEnv();
  521.     }
  522. }