PerfectReplicationUncollateralizedFundingStochastic.java

  1. package org.drip.sample.burgard2013;

  2. import org.drip.analytics.date.*;
  3. import org.drip.exposure.evolver.LatentStateVertexContainer;
  4. import org.drip.exposure.universe.*;
  5. import org.drip.measure.crng.RandomNumberGenerator;
  6. import org.drip.measure.discrete.CorrelatedPathVertexDimension;
  7. import org.drip.measure.dynamics.*;
  8. import org.drip.measure.process.DiffusionEvolver;
  9. import org.drip.measure.realization.*;
  10. import org.drip.measure.statistics.UnivariateDiscreteThin;
  11. import org.drip.numerical.common.FormatUtil;
  12. import org.drip.numerical.linearalgebra.Matrix;
  13. import org.drip.service.env.EnvManager;
  14. import org.drip.state.identifier.OTCFixFloatLabel;
  15. import org.drip.xva.basel.*;
  16. import org.drip.xva.definition.*;
  17. import org.drip.xva.gross.*;
  18. import org.drip.xva.hypothecation.*;
  19. import org.drip.xva.netting.CollateralGroupPath;
  20. import org.drip.xva.strategy.*;
  21. import org.drip.xva.vertex.BurgardKjaerBuilder;

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

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

  96. /**
  97.  * <i>PerfectReplicationUncollateralizedFundingStochastic</i> examines the Basel BCBS 2012 OTC Accounting
  98.  * Impact to a Portfolio of 10 Swaps resulting from the Addition of a New Swap - Comparison via both FVA/FDA
  99.  * and FCA/FBA Schemes. Simulation is carried out under the following Criteria using one of the Generalized
  100.  * Burgard Kjaer (2013) Scheme.
  101.  *  
  102.  * <br><br>
  103.  *  <ul>
  104.  *      <li>
  105.  *          Collateralization Status - Uncollateralized
  106.  *      </li>
  107.  *      <li>
  108.  *          Aggregation Unit         - Funding Group
  109.  *      </li>
  110.  *      <li>
  111.  *          Added Swap Type          - Zero Upfront Par Swap (Neutral)
  112.  *      </li>
  113.  *      <li>
  114.  *          Market Dynamics          - Stochastic (Dynamic Market Evolution)
  115.  *      </li>
  116.  *      <li>
  117.  *          Funding Strategy         - Perfect Replication
  118.  *      </li>
  119.  *  </ul>
  120.  *  
  121.  * The References are:
  122.  *  
  123.  * <br><br>
  124.  *  <ul>
  125.  *      <li>
  126.  *          Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-party
  127.  *              Risk and Funding Costs <i>Journal of Credit Risk</i> <b>7 (3)</b> 1-19
  128.  *      </li>
  129.  *      <li>
  130.  *          Burgard, C., and M. Kjaer (2014): In the Balance <i>Risk</i> <b>24 (11)</b> 72-75
  131.  *      </li>
  132.  *      <li>
  133.  *          Gregory, J. (2009): Being Two-faced over Counter-party Credit Risk <i>Risk</i> <b>20 (2)</b>
  134.  *              86-90
  135.  *      </li>
  136.  *      <li>
  137.  *          Li, B., and Y. Tang (2007): <i>Quantitative Analysis, Derivatives Modeling, and Trading
  138.  *              Strategies in the Presence of Counter-party Credit Risk for the Fixed Income Market</i>
  139.  *              <b>World Scientific Publishing</b> Singapore
  140.  *      </li>
  141.  *      <li>
  142.  *          Piterbarg, V. (2010): Funding Beyond Discounting: Collateral Agreements and Derivatives Pricing
  143.  *              <i>Risk</i> <b>21 (2)</b> 97-102
  144.  *      </li>
  145.  *  </ul>
  146.  *  
  147.  * <br><br>
  148.  *  <ul>
  149.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  150.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/XVAAnalyticsLibrary.md">XVA Analytics Library</a></li>
  151.  *      <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>
  152.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/burgard2013/README.md">Burgard Kjaer (2013) Valuation Adjustments</a></li>
  153.  *  </ul>
  154.  * <br><br>
  155.  *
  156.  * @author Lakshmi Krishnamurthy
  157.  */

  158. public class PerfectReplicationUncollateralizedFundingStochastic {

  159.     private static final double[] NumeraireValueRealization (
  160.         final DiffusionEvolver deNumeraireValue,
  161.         final double dblNumeraireValueInitial,
  162.         final double dblTime,
  163.         final double dblTimeWidth,
  164.         final double[] adblRandom,
  165.         final int iNumStep)
  166.         throws Exception
  167.     {
  168.         double[] adblNumeraireValue = new double[iNumStep + 1];
  169.         adblNumeraireValue[0] = dblNumeraireValueInitial;
  170.         double[] adblTimeWidth = new double[iNumStep];

  171.         for (int i = 0; i < iNumStep; ++i)
  172.             adblTimeWidth[i] = dblTimeWidth;


  173.         JumpDiffusionEdge[] aJDE = deNumeraireValue.incrementSequence (
  174.             new JumpDiffusionVertex (
  175.                 dblTime,
  176.                 dblNumeraireValueInitial,
  177.                 0.,
  178.                 false
  179.             ),
  180.             JumpDiffusionEdgeUnit.Diffusion (
  181.                 adblTimeWidth,
  182.                 adblRandom
  183.             ),
  184.             dblTimeWidth
  185.         );

  186.         for (int j = 1; j <= iNumStep; ++j)
  187.             adblNumeraireValue[j] = aJDE[j - 1].finish();

  188.         return adblNumeraireValue;
  189.     }

  190.     private static final double[] VertexNumeraireRealization (
  191.         final DiffusionEvolver deNumeraireValue,
  192.         final double dblNumeraireValueInitial,
  193.         final double dblTime,
  194.         final double dblTimeWidth,
  195.         final double[] adblRandom,
  196.         final int iNumStep)
  197.         throws Exception
  198.     {
  199.         double[] adblNumeraireValue = new double[iNumStep + 1];
  200.         double[] adblTimeWidth = new double[iNumStep];

  201.         for (int i = 0; i < iNumStep; ++i)
  202.             adblTimeWidth[i] = dblTimeWidth;

  203.         JumpDiffusionVertex[] aJDV = deNumeraireValue.vertexSequenceReverse (
  204.             new JumpDiffusionVertex (
  205.                 dblTime,
  206.                 dblNumeraireValueInitial,
  207.                 0.,
  208.                 false
  209.             ),
  210.             JumpDiffusionEdgeUnit.Diffusion (
  211.                 adblTimeWidth,
  212.                 adblRandom
  213.             ),
  214.             adblTimeWidth
  215.         );

  216.         for (int j = 0; j <= iNumStep; ++j)
  217.             adblNumeraireValue[j] = aJDV[j].value();

  218.         return adblNumeraireValue;
  219.     }

  220.     private static final double[] ATMSwapRateOffsetRealization (
  221.         final DiffusionEvolver deATMSwapRateOffset,
  222.         final double dblATMSwapRateOffsetInitial,
  223.         final double[] adblRandom,
  224.         final double dblTime,
  225.         final double dblTimeWidth,
  226.         final int iNumStep)
  227.         throws Exception
  228.     {
  229.         double[] adblATMSwapRateOffset = new double[iNumStep + 1];
  230.         adblATMSwapRateOffset[0] = dblATMSwapRateOffsetInitial;
  231.         double[] adblTimeWidth = new double[iNumStep];

  232.         for (int i = 0; i < iNumStep; ++i)
  233.             adblTimeWidth[i] = dblTimeWidth;


  234.         JumpDiffusionEdge[] aJDE = deATMSwapRateOffset.incrementSequence (
  235.             new JumpDiffusionVertex (
  236.                 dblTime,
  237.                 dblATMSwapRateOffsetInitial,
  238.                 0.,
  239.                 false
  240.             ),
  241.             JumpDiffusionEdgeUnit.Diffusion (
  242.                 adblTimeWidth,
  243.                 adblRandom
  244.             ),
  245.             dblTimeWidth
  246.         );

  247.         for (int j = 1; j <= iNumStep; ++j)
  248.             adblATMSwapRateOffset[j] = aJDE[j - 1].finish();

  249.         return adblATMSwapRateOffset;
  250.     }

  251.     private static final double[] SwapPortfolioValueRealization (
  252.         final DiffusionEvolver deATMSwapRate,
  253.         final double dblATMSwapRateStart,
  254.         final double[] adblRandom,
  255.         final int iNumStep,
  256.         final double dblTime,
  257.         final double dblTimeWidth,
  258.         final double dblTimeMaturity,
  259.         final double dblSwapNotional)
  260.         throws Exception
  261.     {
  262.         double[] adblSwapPortfolioValueRealization = new double[iNumStep + 1];
  263.         int iMaturityStep = (int) (dblTimeMaturity / dblTimeWidth);

  264.         for (int i = 0; i < iNumStep; ++i)
  265.             adblSwapPortfolioValueRealization[i] = 0.;

  266.         double[] adblATMSwapRateOffsetRealization = ATMSwapRateOffsetRealization (
  267.             deATMSwapRate,
  268.             dblATMSwapRateStart,
  269.             adblRandom,
  270.             dblTime,
  271.             dblTimeWidth,
  272.             iNumStep
  273.         );

  274.         for (int j = 0; j <= iNumStep; ++j)
  275.             adblSwapPortfolioValueRealization[j] = j > iMaturityStep ? 0. :
  276.                 dblSwapNotional * dblTimeWidth * (iMaturityStep - j) * adblATMSwapRateOffsetRealization[j];

  277.         return adblSwapPortfolioValueRealization;
  278.     }

  279.     private static final double[][] Path (
  280.         final double[][] aadblCorrelation,
  281.         final int iNumVertex)
  282.         throws Exception
  283.     {
  284.         CorrelatedPathVertexDimension cpvd = new CorrelatedPathVertexDimension (
  285.             new RandomNumberGenerator(),
  286.             aadblCorrelation,
  287.             iNumVertex,
  288.             1,
  289.             false,
  290.             null
  291.         );

  292.         return cpvd.multiPathVertexRd()[0].flatform();
  293.     }

  294.     private static final ExposureAdjustmentAggregator[] Mix (
  295.         final double dblTimeMaturity1,
  296.         final double dblATMSwapRateOffsetStart1,
  297.         final double dblSwapNotional1,
  298.         final double dblTimeMaturity2,
  299.         final double dblATMSwapRateOffsetStart2,
  300.         final double dblSwapNotional2)
  301.         throws Exception
  302.     {
  303.         int iNumStep = 10;
  304.         int iNumPath = 60000;
  305.         int iNumVertex = 10;
  306.         double dblTime = 5.;
  307.         double dblATMSwapRateOffsetDrift = 0.0;
  308.         double dblATMSwapRateOffsetVolatility = 0.25;
  309.         double dblOvernightNumeraireDrift = 0.004;
  310.         double dblOvernightNumeraireVolatility = 0.02;
  311.         double dblOvernightNumeraireInitial = 1.;
  312.         double dblCSADrift = 0.01;
  313.         double dblCSAVolatility = 0.05;
  314.         double dblCSAInitial = 1.;
  315.         double dblBankHazardRateDrift = 0.002;
  316.         double dblBankHazardRateVolatility = 0.20;
  317.         double dblBankHazardRateInitial = 0.015;
  318.         double dblBankSeniorRecoveryRateDrift = 0.002;
  319.         double dblBankSeniorRecoveryRateVolatility = 0.02;
  320.         double dblBankSeniorRecoveryRateInitial = 0.40;
  321.         double dblBankSubordinateRecoveryRateDrift = 0.001;
  322.         double dblBankSubordinateRecoveryRateVolatility = 0.01;
  323.         double dblBankSubordinateRecoveryRateInitial = 0.15;
  324.         double dblCounterPartyHazardRateDrift = 0.002;
  325.         double dblCounterPartyHazardRateVolatility = 0.30;
  326.         double dblCounterPartyHazardRateInitial = 0.030;
  327.         double dblCounterPartyRecoveryRateDrift = 0.002;
  328.         double dblCounterPartyRecoveryRateVolatility = 0.02;
  329.         double dblCounterPartyRecoveryRateInitial = 0.30;
  330.         double dblBankSeniorFundingSpreadDrift = 0.00002;
  331.         double dblBankSeniorFundingSpreadVolatility = 0.002;
  332.         double dblBankSubordinateFundingSpreadDrift = 0.00001;
  333.         double dblBankSubordinateFundingSpreadVolatility = 0.001;
  334.         double dblCounterPartyFundingSpreadDrift = 0.000022;
  335.         double dblCounterPartyFundingSpreadVolatility = 0.0022;

  336.         double[][] aadblCorrelation = new double[][] {
  337.             {1.00,  0.00,  0.03,  0.07,  0.04,  0.05,  0.00,  0.08,  0.00,  0.00,  0.00},  // PORTFOLIO
  338.             {0.00,  1.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00},  // OVERNIGHT
  339.             {0.03,  0.00,  1.00,  0.26,  0.33,  0.21,  0.00,  0.35,  0.13,  0.00,  0.00},  // CSA
  340.             {0.07,  0.00,  0.26,  1.00,  0.45, -0.17,  0.00,  0.07,  0.77,  0.00,  0.00},  // BANK HAZARD
  341.             {0.04,  0.00,  0.33,  0.45,  1.00, -0.22,  0.00, -0.54,  0.58,  0.00,  0.00},  // COUNTER PARTY HAZARD
  342.             {0.05,  0.00,  0.21, -0.17, -0.22,  1.00,  0.00,  0.47, -0.23,  0.00,  0.00},  // BANK SENIOR RECOVERY
  343.             {0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  1.00,  0.00,  0.00,  0.00,  0.00},  // BANK SUBORDINATE RECOVERY
  344.             {0.08,  0.00,  0.35,  0.07, -0.54,  0.47,  0.00,  1.00,  0.01,  0.00,  0.00},  // COUNTER PARTY RECOVERY
  345.             {0.00,  0.00,  0.13,  0.77,  0.58, -0.23,  0.00,  0.01,  1.00,  0.00,  0.00},  // BANK SENIOR FUNDING SPREAD
  346.             {0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  1.00,  0.00},  // BANK SUBORDINATE FUNDING SPREAD
  347.             {0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  0.00,  1.00}   // COUNTER PARTY FUNDING SPREAD
  348.         };

  349.         JulianDate dtSpot = DateUtil.Today();

  350.         double dblTimeWidth = dblTime / iNumStep;
  351.         JulianDate[] adtVertex = new JulianDate[iNumStep + 1];
  352.         double[][] aadblPortfolio1Value = new double[iNumPath][iNumStep + 1];
  353.         double[][] aadblPortfolio2Value = new double[iNumPath][iNumStep + 1];
  354.         double[][] aadblCollateralBalance = new double[iNumPath][iNumStep + 1];
  355.         MonoPathExposureAdjustment[] aCPGPGround = new MonoPathExposureAdjustment[iNumPath];
  356.         MonoPathExposureAdjustment[] aCPGPExtended = new MonoPathExposureAdjustment[iNumPath];
  357.         double dblBankSeniorFundingSpreadInitial = dblBankHazardRateInitial / (1. - dblBankSeniorRecoveryRateInitial);
  358.         double dblBankSubordinateFundingSpreadInitial = dblBankHazardRateInitial / (1. - dblBankSubordinateRecoveryRateInitial);
  359.         double dblCounterPartyFundingSpreadInitial = dblCounterPartyHazardRateInitial / (1. - dblCounterPartyRecoveryRateInitial);

  360.         DiffusionEvolver deATMSwapRateOffset = new DiffusionEvolver (
  361.             DiffusionEvaluatorLinear.Standard (
  362.                 dblATMSwapRateOffsetDrift,
  363.                 dblATMSwapRateOffsetVolatility
  364.             )
  365.         );

  366.         DiffusionEvolver deOvernightNumeraire = new DiffusionEvolver (
  367.             DiffusionEvaluatorLogarithmic.Standard (
  368.                 dblOvernightNumeraireDrift,
  369.                 dblOvernightNumeraireVolatility
  370.             )
  371.         );

  372.         DiffusionEvolver deCSA = new DiffusionEvolver (
  373.             DiffusionEvaluatorLogarithmic.Standard (
  374.                 dblCSADrift,
  375.                 dblCSAVolatility
  376.             )
  377.         );

  378.         DiffusionEvolver deBankHazardRate = new DiffusionEvolver (
  379.             DiffusionEvaluatorLogarithmic.Standard (
  380.                 dblBankHazardRateDrift,
  381.                 dblBankHazardRateVolatility
  382.             )
  383.         );

  384.         DiffusionEvolver deBankSeniorRecoveryRate = new DiffusionEvolver (
  385.             DiffusionEvaluatorLogarithmic.Standard (
  386.                 dblBankSeniorRecoveryRateDrift,
  387.                 dblBankSeniorRecoveryRateVolatility
  388.             )
  389.         );

  390.         DiffusionEvolver deBankSubordinateRecoveryRate = new DiffusionEvolver (
  391.             DiffusionEvaluatorLogarithmic.Standard (
  392.                 dblBankSubordinateRecoveryRateDrift,
  393.                 dblBankSubordinateRecoveryRateVolatility
  394.             )
  395.         );

  396.         DiffusionEvolver deCounterPartyHazardRate = new DiffusionEvolver (
  397.             DiffusionEvaluatorLogarithmic.Standard (
  398.                 dblCounterPartyHazardRateDrift,
  399.                 dblCounterPartyHazardRateVolatility
  400.             )
  401.         );

  402.         DiffusionEvolver deCounterPartyRecoveryRate = new DiffusionEvolver (
  403.             DiffusionEvaluatorLogarithmic.Standard (
  404.                 dblCounterPartyRecoveryRateDrift,
  405.                 dblCounterPartyRecoveryRateVolatility
  406.             )
  407.         );

  408.         DiffusionEvolver deBankSeniorFundingSpread = new DiffusionEvolver (
  409.             DiffusionEvaluatorLinear.Standard (
  410.                 dblBankSeniorFundingSpreadDrift,
  411.                 dblBankSeniorFundingSpreadVolatility
  412.             )
  413.         );

  414.         DiffusionEvolver deBankSubordinateFundingSpread = new DiffusionEvolver (
  415.             DiffusionEvaluatorLinear.Standard (
  416.                 dblBankSubordinateFundingSpreadDrift,
  417.                 dblBankSubordinateFundingSpreadVolatility
  418.             )
  419.         );

  420.         DiffusionEvolver deCounterPartyFundingSpread = new DiffusionEvolver (
  421.             DiffusionEvaluatorLinear.Standard (
  422.                 dblCounterPartyFundingSpreadDrift,
  423.                 dblCounterPartyFundingSpreadVolatility
  424.             )
  425.         );

  426.         for (int i = 0; i < iNumPath; ++i) {
  427.             double[][] aadblNumeraire = Matrix.Transpose (
  428.                 Path (
  429.                     aadblCorrelation,
  430.                     iNumVertex
  431.                 )
  432.             );

  433.             aadblPortfolio1Value[i] = SwapPortfolioValueRealization (
  434.                 deATMSwapRateOffset,
  435.                 dblATMSwapRateOffsetStart1,
  436.                 aadblNumeraire[0],
  437.                 iNumVertex,
  438.                 dblTime,
  439.                 dblTimeWidth,
  440.                 dblTimeMaturity1,
  441.                 dblSwapNotional1
  442.             );

  443.             aadblPortfolio2Value[i] = SwapPortfolioValueRealization (
  444.                 deATMSwapRateOffset,
  445.                 dblATMSwapRateOffsetStart2,
  446.                 aadblNumeraire[0],
  447.                 iNumVertex,
  448.                 dblTime,
  449.                 dblTimeWidth,
  450.                 dblTimeMaturity2,
  451.                 dblSwapNotional2
  452.             );

  453.             double[] adblOvernightNumeraire = VertexNumeraireRealization (
  454.                 deOvernightNumeraire,
  455.                 dblOvernightNumeraireInitial,
  456.                 dblTime,
  457.                 dblTimeWidth,
  458.                 aadblNumeraire[1],
  459.                 iNumStep
  460.             );

  461.             double[] adblCSA = VertexNumeraireRealization (
  462.                 deCSA,
  463.                 dblCSAInitial,
  464.                 dblTime,
  465.                 dblTimeWidth,
  466.                 aadblNumeraire[2],
  467.                 iNumStep
  468.             );

  469.             double[] adblBankHazardRate = NumeraireValueRealization (
  470.                 deBankHazardRate,
  471.                 dblBankHazardRateInitial,
  472.                 dblTime,
  473.                 dblTimeWidth,
  474.                 aadblNumeraire[3],
  475.                 iNumStep
  476.             );

  477.             double[] adblCounterPartyHazardRate = NumeraireValueRealization (
  478.                 deCounterPartyHazardRate,
  479.                 dblCounterPartyHazardRateInitial,
  480.                 dblTime,
  481.                 dblTimeWidth,
  482.                 aadblNumeraire[4],
  483.                 iNumStep
  484.             );

  485.             double[] adblBankSeniorRecoveryRate = NumeraireValueRealization (
  486.                 deBankSeniorRecoveryRate,
  487.                 dblBankSeniorRecoveryRateInitial,
  488.                 dblTime,
  489.                 dblTimeWidth,
  490.                 aadblNumeraire[5],
  491.                 iNumStep
  492.             );

  493.             double[] adblBankSubordinateRecoveryRate = NumeraireValueRealization (
  494.                 deBankSubordinateRecoveryRate,
  495.                 dblBankSubordinateRecoveryRateInitial,
  496.                 dblTime,
  497.                 dblTimeWidth,
  498.                 aadblNumeraire[6],
  499.                 iNumStep
  500.             );

  501.             double[] adblCounterPartyRecoveryRate = NumeraireValueRealization (
  502.                 deCounterPartyRecoveryRate,
  503.                 dblCounterPartyRecoveryRateInitial,
  504.                 dblTime,
  505.                 dblTimeWidth,
  506.                 aadblNumeraire[7],
  507.                 iNumStep
  508.             );

  509.             double[] adblBankSeniorFundingSpread = NumeraireValueRealization (
  510.                 deBankSeniorFundingSpread,
  511.                 dblBankSeniorFundingSpreadInitial,
  512.                 dblTime,
  513.                 dblTimeWidth,
  514.                 aadblNumeraire[8],
  515.                 iNumStep
  516.             );

  517.             double[] adblBankSubordinateFundingSpread = NumeraireValueRealization (
  518.                 deBankSubordinateFundingSpread,
  519.                 dblBankSubordinateFundingSpreadInitial,
  520.                 dblTime,
  521.                 dblTimeWidth,
  522.                 aadblNumeraire[9],
  523.                 iNumStep
  524.             );

  525.             double[] adblCounterPartyFundingSpread = NumeraireValueRealization (
  526.                 deCounterPartyFundingSpread,
  527.                 dblCounterPartyFundingSpreadInitial,
  528.                 dblTime,
  529.                 dblTimeWidth,
  530.                 aadblNumeraire[10],
  531.                 iNumStep
  532.             );

  533.             MarketVertex[] aMV = new MarketVertex [iNumStep + 1];
  534.             CollateralGroupVertex[] aCGV1 = new CollateralGroupVertex[iNumStep + 1];
  535.             CollateralGroupVertex[] aCGV2 = new CollateralGroupVertex[iNumStep + 1];

  536.             for (int j = 0; j <= iNumStep; ++j)
  537.             {
  538.                 LatentStateVertexContainer latentStateVertexContainer = new LatentStateVertexContainer();

  539.                 latentStateVertexContainer.add (
  540.                     OTCFixFloatLabel.Standard ("USD-3M-10Y"),
  541.                     Double.NaN
  542.                 );

  543.                 aMV[j] = MarketVertex.Nodal (
  544.                     adtVertex[j] = dtSpot.addMonths (6 * j),
  545.                     dblOvernightNumeraireDrift,
  546.                     adblOvernightNumeraire[j],
  547.                     dblCSADrift,
  548.                     adblCSA[j],
  549.                     new MarketVertexEntity (
  550.                         Math.exp (-0.5 * adblBankHazardRate[j] * j),
  551.                         adblBankHazardRate[j],
  552.                         adblBankSeniorRecoveryRate[j],
  553.                         adblBankSeniorFundingSpread[j],
  554.                         Math.exp (-0.5 * adblBankHazardRate[j] * (1. - adblBankSeniorRecoveryRate[j]) * iNumStep),
  555.                         adblBankSubordinateRecoveryRate[j],
  556.                         adblBankSubordinateFundingSpread[j],
  557.                         Math.exp (-0.5 * adblBankHazardRate[j] * (1. - adblBankSubordinateRecoveryRate[j]) * iNumStep)
  558.                     ),
  559.                     new MarketVertexEntity (
  560.                         Math.exp (-0.5 * adblCounterPartyHazardRate[j] * j),
  561.                         adblCounterPartyHazardRate[j],
  562.                         adblCounterPartyRecoveryRate[j],
  563.                         adblCounterPartyFundingSpread[j],
  564.                         Math.exp (-0.5 * adblCounterPartyHazardRate[j] * (1. - adblCounterPartyRecoveryRate[j]) * iNumStep),
  565.                         Double.NaN,
  566.                         Double.NaN,
  567.                         Double.NaN
  568.                     ),
  569.                     latentStateVertexContainer
  570.                 );

  571.                 aadblCollateralBalance[i][j] = 0.;

  572.                 CloseOut cog = new CloseOutBilateral (
  573.                     adblBankSeniorRecoveryRate[j],
  574.                     adblCounterPartyRecoveryRate[j]
  575.                 );

  576.                 if (0 != j) {
  577.                     aCGV1[j] = BurgardKjaerBuilder.HedgeErrorDualBond (
  578.                         adtVertex[j],
  579.                         aadblPortfolio1Value[i][j],
  580.                         0.,
  581.                         0.,
  582.                         0.,
  583.                         new MarketEdge (
  584.                             aMV[j - 1],
  585.                             aMV[j]
  586.                         ),
  587.                         cog
  588.                     );

  589.                     aCGV2[j] = BurgardKjaerBuilder.HedgeErrorDualBond (
  590.                         adtVertex[j],
  591.                         aadblPortfolio2Value[i][j],
  592.                         0.,
  593.                         0.,
  594.                         0.,
  595.                         new MarketEdge (
  596.                             aMV[j - 1],
  597.                             aMV[j]
  598.                         ),
  599.                         cog
  600.                     );
  601.                 } else {
  602.                     aCGV1[j] = BurgardKjaerBuilder.Initial (
  603.                         adtVertex[j],
  604.                         aadblPortfolio1Value[i][0],
  605.                         aMV[j],
  606.                         cog
  607.                     );

  608.                     aCGV2[j] = BurgardKjaerBuilder.Initial (
  609.                         adtVertex[j],
  610.                         aadblPortfolio2Value[i][0],
  611.                         aMV[j],
  612.                         cog
  613.                     );
  614.                 }
  615.             }

  616.             MarketPath np = MarketPath.FromMarketVertexArray (aMV);

  617.             CollateralGroupPath[] aCGP1 = new CollateralGroupPath[] {
  618.                 new CollateralGroupPath (
  619.                     aCGV1,
  620.                     np
  621.                 )
  622.             };

  623.             CollateralGroupPath[] aCGP2 = new CollateralGroupPath[] {
  624.                 new CollateralGroupPath (
  625.                     aCGV2,
  626.                     np
  627.                 )
  628.             };

  629.             aCPGPGround[i] = new MonoPathExposureAdjustment (
  630.                 new AlbaneseAndersenFundingGroupPath[] {
  631.                     new AlbaneseAndersenFundingGroupPath (
  632.                         new AlbaneseAndersenNettingGroupPath[] {
  633.                             new AlbaneseAndersenNettingGroupPath (
  634.                                 aCGP1,
  635.                                 np
  636.                             )
  637.                         },
  638.                         np
  639.                     )
  640.                 }
  641.             );

  642.             aCPGPExtended[i] = new MonoPathExposureAdjustment (
  643.                 new AlbaneseAndersenFundingGroupPath[] {
  644.                     new AlbaneseAndersenFundingGroupPath (
  645.                         new AlbaneseAndersenNettingGroupPath[] {
  646.                             new AlbaneseAndersenNettingGroupPath (
  647.                                 aCGP1,
  648.                                 np
  649.                             ),
  650.                             new AlbaneseAndersenNettingGroupPath (
  651.                                 aCGP2,
  652.                                 np
  653.                             )
  654.                         },
  655.                         np
  656.                     )
  657.                 }
  658.             );
  659.         }

  660.         return new ExposureAdjustmentAggregator[] {
  661.             new ExposureAdjustmentAggregator (aCPGPGround),
  662.             new ExposureAdjustmentAggregator (aCPGPExtended)
  663.         };
  664.     }

  665.     private static final void CPGDDump (
  666.         final String strHeader,
  667.         final ExposureAdjustmentDigest ead)
  668.         throws Exception
  669.     {
  670.         System.out.println();

  671.         UnivariateDiscreteThin udtUCOLVA = ead.ucolva();

  672.         UnivariateDiscreteThin udtFTDCOLVA = ead.ftdcolva();

  673.         UnivariateDiscreteThin udtUCVA = ead.ucva();

  674.         UnivariateDiscreteThin udtFTDCVA = ead.ftdcva();

  675.         UnivariateDiscreteThin udtCVACL = ead.cvacl();

  676.         UnivariateDiscreteThin udtCVA = ead.cva();

  677.         UnivariateDiscreteThin udtDVA = ead.dva();

  678.         UnivariateDiscreteThin udtFVA = ead.fva();

  679.         UnivariateDiscreteThin udtFDA = ead.fda();

  680.         UnivariateDiscreteThin udtFCA = ead.fca();

  681.         UnivariateDiscreteThin udtFBA = ead.fba();

  682.         UnivariateDiscreteThin udtSFVA = ead.sfva();

  683.         System.out.println (
  684.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  685.         );

  686.         System.out.println (strHeader);

  687.         System.out.println (
  688.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  689.         );

  690.         System.out.println (
  691.             "\t||  OODLE  => UCOLVA  | FTDCOLVA |  UCVA   | FTDCVA  |  CVACL  |   CVA   |   DVA   |   FVA   |   FDA   |   FCA   |   FBA   |   SFVA  ||"
  692.         );

  693.         System.out.println (
  694.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  695.         );

  696.         System.out.println (
  697.             "\t|| Average => " +
  698.             FormatUtil.FormatDouble (udtUCOLVA.average(), 2, 2, 1.) + "  |  " +
  699.             FormatUtil.FormatDouble (udtFTDCOLVA.average(), 2, 2, 1.) + "  | " +
  700.             FormatUtil.FormatDouble (udtUCVA.average(), 2, 2, 1.) + "  | " +
  701.             FormatUtil.FormatDouble (udtFTDCVA.average(), 2, 2, 1.) + "  | " +
  702.             FormatUtil.FormatDouble (udtCVACL.average(), 2, 2, 1.) + "  | " +
  703.             FormatUtil.FormatDouble (udtCVA.average(), 2, 2, 1.) + "  | " +
  704.             FormatUtil.FormatDouble (udtDVA.average(), 2, 2, 1.) + "  | " +
  705.             FormatUtil.FormatDouble (udtFVA.average(), 2, 2, 1.) + "  | " +
  706.             FormatUtil.FormatDouble (udtFDA.average(), 2, 2, 1.) + "  | " +
  707.             FormatUtil.FormatDouble (udtFCA.average(), 2, 2, 1.) + "  | " +
  708.             FormatUtil.FormatDouble (udtFBA.average(), 2, 2, 1.) + "  | " +
  709.             FormatUtil.FormatDouble (udtSFVA.average(), 2, 2, 1.) + "  ||"
  710.         );

  711.         System.out.println (
  712.             "\t|| Minimum => " +
  713.             FormatUtil.FormatDouble (udtUCOLVA.minimum(), 2, 2, 1.) + "  |  " +
  714.             FormatUtil.FormatDouble (udtFTDCOLVA.minimum(), 2, 2, 1.) + "  | " +
  715.             FormatUtil.FormatDouble (udtUCVA.minimum(), 2, 2, 1.) + "  | " +
  716.             FormatUtil.FormatDouble (udtFTDCVA.minimum(), 2, 2, 1.) + "  | " +
  717.             FormatUtil.FormatDouble (udtCVACL.minimum(), 2, 2, 1.) + "  | " +
  718.             FormatUtil.FormatDouble (udtCVA.minimum(), 2, 2, 1.) + "  | " +
  719.             FormatUtil.FormatDouble (udtDVA.minimum(), 2, 2, 1.) + "  | " +
  720.             FormatUtil.FormatDouble (udtFVA.minimum(), 2, 2, 1.) + "  | " +
  721.             FormatUtil.FormatDouble (udtFDA.minimum(), 2, 2, 1.) + "  | " +
  722.             FormatUtil.FormatDouble (udtFCA.minimum(), 2, 2, 1.) + "  | " +
  723.             FormatUtil.FormatDouble (udtFBA.minimum(), 2, 2, 1.) + "  | " +
  724.             FormatUtil.FormatDouble (udtSFVA.minimum(), 2, 2, 1.) + "  ||"
  725.         );

  726.         System.out.println (
  727.             "\t|| Maximum => " +
  728.             FormatUtil.FormatDouble (udtUCOLVA.maximum(), 2, 2, 1.) + "  |  " +
  729.             FormatUtil.FormatDouble (udtFTDCOLVA.maximum(), 2, 2, 1.) + "  | " +
  730.             FormatUtil.FormatDouble (udtUCVA.maximum(), 2, 2, 1.) + "  | " +
  731.             FormatUtil.FormatDouble (udtFTDCVA.maximum(), 2, 2, 1.) + "  | " +
  732.             FormatUtil.FormatDouble (udtCVACL.maximum(), 2, 2, 1.) + "  | " +
  733.             FormatUtil.FormatDouble (udtCVA.maximum(), 2, 2, 1.) + "  | " +
  734.             FormatUtil.FormatDouble (udtDVA.maximum(), 2, 2, 1.) + "  | " +
  735.             FormatUtil.FormatDouble (udtFVA.maximum(), 2, 2, 1.) + "  | " +
  736.             FormatUtil.FormatDouble (udtFDA.maximum(), 2, 2, 1.) + "  | " +
  737.             FormatUtil.FormatDouble (udtFCA.maximum(), 2, 2, 1.) + "  | " +
  738.             FormatUtil.FormatDouble (udtFBA.maximum(), 2, 2, 1.) + "  | " +
  739.             FormatUtil.FormatDouble (udtSFVA.maximum(), 2, 2, 1.) + "  ||"
  740.         );

  741.         System.out.println (
  742.             "\t||  Error  => " +
  743.             FormatUtil.FormatDouble (udtUCOLVA.error(), 2, 2, 1.) + "  |  " +
  744.             FormatUtil.FormatDouble (udtFTDCOLVA.error(), 2, 2, 1.) + "  | " +
  745.             FormatUtil.FormatDouble (udtUCVA.error(), 2, 2, 1.) + "  | " +
  746.             FormatUtil.FormatDouble (udtFTDCVA.error(), 2, 2, 1.) + "  | " +
  747.             FormatUtil.FormatDouble (udtCVACL.error(), 2, 2, 1.) + "  | " +
  748.             FormatUtil.FormatDouble (udtCVA.error(), 2, 2, 1.) + "  | " +
  749.             FormatUtil.FormatDouble (udtDVA.error(), 2, 2, 1.) + "  | " +
  750.             FormatUtil.FormatDouble (udtFVA.error(), 2, 2, 1.) + "  | " +
  751.             FormatUtil.FormatDouble (udtFDA.error(), 2, 2, 1.) + "  | " +
  752.             FormatUtil.FormatDouble (udtFCA.error(), 2, 2, 1.) + "  | " +
  753.             FormatUtil.FormatDouble (udtFBA.error(), 2, 2, 1.) + "  | " +
  754.             FormatUtil.FormatDouble (udtSFVA.error(), 2, 2, 1.) + "  ||"
  755.         );

  756.         System.out.println (
  757.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  758.         );
  759.     }

  760.     private static final void CPGDDiffDump (
  761.         final String strHeader,
  762.         final ExposureAdjustmentDigest eadGround,
  763.         final ExposureAdjustmentDigest eadExpanded)
  764.         throws Exception
  765.     {
  766.         System.out.println();

  767.         System.out.println (
  768.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  769.         );

  770.         System.out.println (strHeader);

  771.         System.out.println (
  772.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  773.         );

  774.         System.out.println (
  775.             "\t||  OODLE  => UCOLVA  | FTDCOLVA |  UCVA   | FTDCVA  |  CVACL  |   CVA   |   DVA   |   FVA   |   FDA   |   FCA   |   FBA   |   SFVA  ||"
  776.         );

  777.         System.out.println (
  778.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  779.         );

  780.         System.out.println (
  781.             "\t|| Average => " +
  782.             FormatUtil.FormatDouble (eadExpanded.ucolva().average() - eadGround.ucolva().average(), 3, 1, 10000.) + "  |  " +
  783.             FormatUtil.FormatDouble (eadExpanded.ftdcolva().average() - eadGround.ftdcolva().average(), 3, 1, 10000.) + "  | " +
  784.             FormatUtil.FormatDouble (eadExpanded.ucva().average() - eadGround.ucva().average(), 3, 1, 10000.) + "  | " +
  785.             FormatUtil.FormatDouble (eadExpanded.ftdcva().average() - eadGround.ftdcva().average(), 3, 1, 10000.) + "  | " +
  786.             FormatUtil.FormatDouble (eadExpanded.cvacl().average() - eadGround.cvacl().average(), 3, 1, 10000.) + "  | " +
  787.             FormatUtil.FormatDouble (eadExpanded.cva().average() - eadGround.cva().average(), 3, 1, 10000.) + "  | " +
  788.             FormatUtil.FormatDouble (eadExpanded.dva().average() - eadGround.dva().average(), 3, 1, 10000.) + "  | " +
  789.             FormatUtil.FormatDouble (eadExpanded.fva().average() - eadGround.fva().average(), 3, 1, 10000.) + "  | " +
  790.             FormatUtil.FormatDouble (eadExpanded.fda().average() - eadGround.fda().average(), 3, 1, 10000.) + "  | " +
  791.             FormatUtil.FormatDouble (eadExpanded.fca().average() - eadGround.fca().average(), 3, 1, 10000.) + "  | " +
  792.             FormatUtil.FormatDouble (eadExpanded.fba().average() - eadGround.fba().average(), 3, 1, 10000.) + "  | " +
  793.             FormatUtil.FormatDouble (eadExpanded.sfva().average() - eadGround.sfva().average(), 3, 1, 10000.) + "  ||"
  794.         );

  795.         System.out.println (
  796.             "\t||-----------------------------------------------------------------------------------------------------------------------------------||"
  797.         );
  798.     }

  799.     private static final void BaselAccountingMetrics (
  800.         final String strHeader,
  801.         final ExposureAdjustmentAggregator cpgaGround,
  802.         final ExposureAdjustmentAggregator cpgaExpanded)
  803.         throws Exception
  804.     {
  805.         OTCAccountingModus oasFCAFBA = new OTCAccountingModusFCAFBA (cpgaGround);

  806.         OTCAccountingModus oasFVAFDA = new OTCAccountingModusFVAFDA (cpgaGround);

  807.         OTCAccountingPolicy oapFCAFBA = oasFCAFBA.feePolicy (cpgaExpanded);

  808.         OTCAccountingPolicy oapFVAFDA = oasFVAFDA.feePolicy (cpgaExpanded);

  809.         System.out.println();

  810.         System.out.println (
  811.             "\t||---------------------------------------------------------------------||"
  812.         );

  813.         System.out.println (strHeader);

  814.         System.out.println (
  815.             "\t||---------------------------------------------------------------------||"
  816.         );

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

  820.         System.out.println (
  821.             "\t||         - Accounting Type (FCA/FBA vs. FVA/FDA)                     ||"
  822.         );

  823.         System.out.println (
  824.             "\t||         - Contra Asset Adjustment                                   ||"
  825.         );

  826.         System.out.println (
  827.             "\t||         - Contra Liability Adjustment                               ||"
  828.         );

  829.         System.out.println (
  830.             "\t||         - FTP (Funding Transfer Pricing) (bp)                       ||"
  831.         );

  832.         System.out.println (
  833.             "\t||         - CET1 (Common Equity Tier I) Change (bp)                   ||"
  834.         );

  835.         System.out.println (
  836.             "\t||         - CL (Contra Liability) Change (bp)                         ||"
  837.         );

  838.         System.out.println (
  839.             "\t||         - PFV (Porfolio Value) Change (Income) (bp)                 ||"
  840.         );

  841.         System.out.println (
  842.             "\t||---------------------------------------------------------------------||"
  843.         );

  844.         System.out.println ("\t|| FCA/FBA Accounting => " +
  845.             FormatUtil.FormatDouble (oasFCAFBA.contraAssetAdjustment(), 1, 4, 1.) + " | " +
  846.             FormatUtil.FormatDouble (oasFCAFBA.contraLiabilityAdjustment(), 1, 4, 1.) + " | " +
  847.             FormatUtil.FormatDouble (oapFCAFBA.fundingTransferPricing(), 3, 0, 10000.) + " | " +
  848.             FormatUtil.FormatDouble (oapFCAFBA.cet1Change(), 3, 0, 10000.) + " | " +
  849.             FormatUtil.FormatDouble (oapFCAFBA.contraLiabilityChange(), 3, 0, 10000.) + " | " +
  850.             FormatUtil.FormatDouble (oapFCAFBA.portfolioValueChange(), 3, 0, 10000.) + " || "
  851.         );

  852.         System.out.println ("\t|| FVA/FDA Accounting => " +
  853.             FormatUtil.FormatDouble (oasFVAFDA.contraAssetAdjustment(), 1, 4, 1.) + " | " +
  854.             FormatUtil.FormatDouble (oasFVAFDA.contraLiabilityAdjustment(), 1, 4, 1.) + " | " +
  855.             FormatUtil.FormatDouble (oapFVAFDA.fundingTransferPricing(), 3, 0, 10000.) + " | " +
  856.             FormatUtil.FormatDouble (oapFVAFDA.cet1Change(), 3, 0, 10000.) + " | " +
  857.             FormatUtil.FormatDouble (oapFVAFDA.contraLiabilityChange(), 3, 0, 10000.) + " | " +
  858.             FormatUtil.FormatDouble (oapFVAFDA.portfolioValueChange(), 3, 0, 10000.) + " || "
  859.         );

  860.         System.out.println (
  861.             "\t||---------------------------------------------------------------------||"
  862.         );

  863.         System.out.println();
  864.     }

  865.     public static final void main (
  866.         final String[] astrArgs)
  867.         throws Exception
  868.     {
  869.         EnvManager.InitEnv ("");

  870.         ExposureAdjustmentAggregator[] aCPGA = Mix (
  871.             5.,
  872.             0.,
  873.             100.,
  874.             5.,
  875.             0.,
  876.             1.
  877.         );

  878.         ExposureAdjustmentAggregator cpgaGround = aCPGA[0];
  879.         ExposureAdjustmentAggregator cpgaExtended = aCPGA[1];

  880.         ExposureAdjustmentDigest cpgdGround = cpgaGround.digest();

  881.         ExposureAdjustmentDigest cpgdExtended = cpgaExtended.digest();

  882.         CPGDDump (
  883.             "\t||                                                  GROUND BOOK ADJUSTMENT METRICS                                                   ||",
  884.             cpgdGround
  885.         );

  886.         CPGDDump (
  887.             "\t||                                                 EXTENDED BOOK ADJUSTMENT METRICS                                                  ||",
  888.             cpgdExtended
  889.         );

  890.         CPGDDiffDump (
  891.             "\t||                                             TRADE INCREMENT ADJUSTMENT METRICS (bp)                                               ||",
  892.             cpgdGround,
  893.             cpgdExtended
  894.         );

  895.         BaselAccountingMetrics (
  896.             "\t||           ALBANESE & ANDERSEN (2015) BCBS OTC ACCOUNTING            ||",
  897.             cpgaGround,
  898.             cpgaExtended
  899.         );

  900.         EnvManager.TerminateEnv();
  901.     }
  902. }