Table8Reconciler.java

  1. package org.drip.sample.helitterman;

  2. import org.drip.measure.bayesian.R1MultivariateConvolutionMetrics;
  3. import org.drip.measure.continuous.MultivariateMeta;
  4. import org.drip.measure.gaussian.*;
  5. import org.drip.measure.statistics.MultivariateMoments;
  6. import org.drip.numerical.common.FormatUtil;
  7. import org.drip.portfolioconstruction.allocator.*;
  8. import org.drip.portfolioconstruction.asset.*;
  9. import org.drip.portfolioconstruction.bayesian.*;
  10. import org.drip.portfolioconstruction.params.AssetUniverseStatisticalProperties;
  11. import org.drip.service.env.EnvManager;

  12. /*
  13.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  14.  */

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

  76. /**
  77.  * <i>Table8Reconciler</i> reconciles the First Set of Outputs (Table #8) of the Black-Litterman Model
  78.  * Process as illustrated in the Following Paper:
  79.  *  
  80.  * <br><br>
  81.  *  <ul>
  82.  *      <li>
  83.  *          He. G., and R. Litterman (1999): The Intuition behind the Black-Litterman Model Portfolios,
  84.  *              Goldman Sachs Asset Management
  85.  *      </li>
  86.  *  </ul>
  87.  *  
  88.  * <br><br>
  89.  *  <ul>
  90.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  91.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AssetAllocationAnalyticsLibrary.md">Asset Allocation Analytics Library</a></li>
  92.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">Sample</a></li>
  93.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/helitterman/README.md">He and Litterman (1999) Reconcilers</a></li>
  94.  *  </ul>
  95.  * <br><br>
  96.  *
  97.  * @author Lakshmi Krishnamurthy
  98.  */

  99. public class Table8Reconciler
  100. {

  101.     public static final void main (
  102.         final String[] argumentArray)
  103.         throws Exception
  104.     {
  105.         EnvManager.InitEnv ("");

  106.         String[] assetIDArray = new String[]
  107.         {
  108.             "AUS",
  109.             "CAD",
  110.             "FRA",
  111.             "GER",
  112.             "JPN",
  113.             "UK ",
  114.             "USA"
  115.         };
  116.         double[] assetEquilibriumWeightArray = new double[]
  117.         {
  118.             0.016,
  119.             0.022,
  120.             0.052,
  121.             0.055,
  122.             0.116,
  123.             0.124,
  124.             0.615
  125.         };
  126.         double[][] assetExcessReturnsCorrelationMatrix = new double[][]
  127.         {
  128.             {1.000, 0.488, 0.478, 0.515, 0.439, 0.512, 0.491},
  129.             {0.488, 1.000, 0.664, 0.655, 0.310, 0.608, 0.779},
  130.             {0.478, 0.664, 1.000, 0.861, 0.355, 0.783, 0.668},
  131.             {0.515, 0.655, 0.861, 1.000, 0.354, 0.777, 0.653},
  132.             {0.439, 0.310, 0.355, 0.354, 1.000, 0.405, 0.306},
  133.             {0.512, 0.608, 0.783, 0.777, 0.405, 1.000, 0.652},
  134.             {0.491, 0.779, 0.668, 0.653, 0.306, 0.652, 1.000}
  135.         };
  136.         double[] assetExcessReturnsVolatilityArray = new double[]
  137.         {
  138.             0.160,
  139.             0.203,
  140.             0.248,
  141.             0.271,
  142.             0.210,
  143.             0.200,
  144.             0.187
  145.         };
  146.         double[][] assetSpaceViewProjectionMatrix = new double[][]
  147.         {
  148.             {0.000,  0.000, -0.295,  1.000,  0.000, -0.705,  0.000},
  149.             {0.000,  1.000,  0.000,  0.000,  0.000,  0.000, -1.000},
  150.             {0.000,  1.000,  0.000,  0.000, -1.000,  0.000,  0.000}
  151.         };
  152.         double tau = 0.05;
  153.         double riskAversion = 2.5;
  154.         double riskFreeRate = 0.0;
  155.         double[] projectionExpectedExcessReturnsArray = new double[]
  156.         {
  157.             0.0500,
  158.             0.0400,
  159.             0.0412
  160.         };

  161.         double[] assetSpaceJointReturnsReconcilerArray = new double[]
  162.         {
  163.             0.043,
  164.             0.089,
  165.             0.093,
  166.             0.106,
  167.             0.046,
  168.             0.069,
  169.             0.072
  170.         };
  171.         double[] posteriorOptimalWeightsReconcilerArray = new double[]
  172.         {
  173.              0.015,
  174.              0.539,
  175.             -0.005,
  176.              0.236,
  177.              0.110,
  178.             -0.011,
  179.              0.068
  180.         };
  181.         double[] posteriorOptimalDeviationReconcilerArray = new double[]
  182.         {
  183.              0.000,
  184.              0.518,
  185.             -0.054,
  186.              0.184,
  187.              0.000,
  188.             -0.130,
  189.             -0.518
  190.         };
  191.         double[] peLoadingsReconcilerArray = new double[]
  192.         {
  193.             0.193,
  194.             0.544,
  195.             0.000
  196.         };

  197.         double[][] projectionExcessReturnsCovarianceMatrix = new double[][]
  198.         {
  199.             {0.043 * tau, 0.000 * tau, 0.000 * tau},
  200.             {0.000 * tau, 0.017 * tau, 0.000 * tau},
  201.             {0.000 * tau, 0.000 * tau, 0.059 * tau}
  202.         };

  203.         R1MultivariateNormal viewDistribution = R1MultivariateNormal.Standard (
  204.             new MultivariateMeta (
  205.                 new String[]
  206.                 {
  207.                     "PROJECTION #1",
  208.                     "PROJECTION #2",
  209.                     "PROJECTION #3"
  210.                 }
  211.             ),
  212.             projectionExpectedExcessReturnsArray,
  213.             projectionExcessReturnsCovarianceMatrix
  214.         );

  215.         double[][] assetExcessReturnsCovarianceMatrix = new double[assetIDArray.length][assetIDArray.length];

  216.         for (int assetIndexI = 0;
  217.             assetIndexI < assetIDArray.length;
  218.             ++assetIndexI)
  219.         {
  220.             for (int assetIndexJ = 0;
  221.                 assetIndexJ < assetIDArray.length;
  222.                 ++assetIndexJ)
  223.             {
  224.                 assetExcessReturnsCovarianceMatrix[assetIndexI][assetIndexJ] =
  225.                     assetExcessReturnsCorrelationMatrix[assetIndexI][assetIndexJ] *
  226.                     assetExcessReturnsVolatilityArray[assetIndexI] *
  227.                     assetExcessReturnsVolatilityArray[assetIndexJ];
  228.             }
  229.         }

  230.         BlackLittermanCombinationEngine blackLittermanCombinationEngine =
  231.             new BlackLittermanCombinationEngine (
  232.                 ForwardReverseHoldingsAllocation.Reverse (
  233.                     Portfolio.Standard (
  234.                         assetIDArray,
  235.                         assetEquilibriumWeightArray
  236.                     ),
  237.                     assetExcessReturnsCovarianceMatrix,
  238.                     riskAversion
  239.                 ),
  240.                 new PriorControlSpecification (
  241.                     false,
  242.                     riskFreeRate,
  243.                     tau
  244.                 ),
  245.                 new ProjectionSpecification (
  246.                     viewDistribution,
  247.                     assetSpaceViewProjectionMatrix
  248.                 )
  249.             );

  250.         R1MultivariateConvolutionMetrics jointPosteriorMetrics =
  251.             blackLittermanCombinationEngine.customConfidenceRun().jointPosteriorMetrics();

  252.         R1MultivariateNormal jointDistribution = (R1MultivariateNormal) jointPosteriorMetrics.joint();

  253.         R1MultivariateNormal posteriorDistribution =
  254.             (R1MultivariateNormal) jointPosteriorMetrics.posterior();

  255.         double[] assetSpaceJointReturnsArray = jointDistribution.mean();

  256.         double[][] assetSpaceJointCovarianceMatrix = jointDistribution.covariance().covarianceMatrix();

  257.         double[][] assetSpacePosteriorCovarianceMatrix =
  258.             posteriorDistribution.covariance().covarianceMatrix();

  259.         AssetComponent[] assetComponentArray = new QuadraticMeanVarianceOptimizer().allocate (
  260.             new HoldingsAllocationControl (
  261.                 assetIDArray,
  262.                 CustomRiskUtilitySettings.RiskAversion (riskAversion),
  263.                 EqualityConstraintSettings.Unconstrained()
  264.             ),
  265.             AssetUniverseStatisticalProperties.FromMultivariateMetrics (
  266.                 MultivariateMoments.Standard (
  267.                     assetIDArray,
  268.                     posteriorDistribution.mean(),
  269.                     assetSpacePosteriorCovarianceMatrix
  270.                 )
  271.             )
  272.         ).optimalPortfolio().assetComponentArray();

  273.         ProjectionExposure projectionExposure =
  274.             blackLittermanCombinationEngine.projectionExposureAttribution();

  275.         double[] interViewComponentArray = projectionExposure.interViewComponentArray();

  276.         double[] intraViewComponentArray = projectionExposure.intraViewComponentArray();

  277.         double[] priorViewComponentArray = projectionExposure.priorViewComponentArray();

  278.         double[] cumulativeViewComponentLoadingArray =
  279.             projectionExposure.cumulativeViewComponentLoadingArray();

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

  281.         System.out.println ("\t| TAU   => " + FormatUtil.FormatDouble (tau, 1, 8, 1.) + "   ||");

  282.         System.out.println ("\t| DELTA => " + FormatUtil.FormatDouble (riskAversion, 1, 8, 1.) + "   ||");

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

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

  285.         System.out.println ("\t|  ASSET EXCESS RETURNS  ||");

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

  287.         System.out.println ("\t|   ID  => EQ WT |  VOL  ||");

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

  289.         for (int assetIndex = 0;
  290.             assetIndex < assetSpaceJointReturnsReconcilerArray.length;
  291.             ++assetIndex)
  292.         {
  293.             System.out.println (
  294.                 "\t| [" + assetIDArray[assetIndex] + "] =>" +
  295.                 FormatUtil.FormatDouble (assetEquilibriumWeightArray[assetIndex], 2, 1, 100.) + "% |" +
  296.                 FormatUtil.FormatDouble (assetExcessReturnsVolatilityArray[assetIndex], 2, 1, 100.) + "% ||"
  297.             );
  298.         }

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

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

  301.         System.out.println ("\t|                           PRIOR CROSS ASSET CORRELATION MATRIX                                 ||");

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

  303.         String header = "\t|     |";

  304.         for (int assetIndex = 0;
  305.             assetIndex < assetIDArray.length;
  306.             ++assetIndex)
  307.         {
  308.             header += "    " + assetIDArray[assetIndex] + "     |";
  309.         }

  310.         System.out.println (header + "|");

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

  312.         for (int assetIndexI = 0;
  313.             assetIndexI < assetIDArray.length;
  314.             ++assetIndexI)
  315.         {
  316.             String dump = "\t| " + assetIDArray[assetIndexI] + " ";

  317.             for (int assetIndexJ = 0;
  318.                 assetIndexJ < assetIDArray.length;
  319.                 ++assetIndexJ)
  320.             {
  321.                 dump += "|" + FormatUtil.FormatDouble (
  322.                     assetExcessReturnsCorrelationMatrix[assetIndexI][assetIndexJ], 1, 8, 1.
  323.                 ) + " ";
  324.             }

  325.             System.out.println (dump + "||");
  326.         }

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

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

  329.         System.out.println ("\t|                           PRIOR CROSS ASSET COVARIANCE MATRIX                                  ||");

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

  331.         header = "\t|     |";

  332.         for (int assetIndex = 0;
  333.             assetIndex < assetIDArray.length;
  334.             ++assetIndex)
  335.         {
  336.             header += "    " + assetIDArray[assetIndex] + "     |";
  337.         }

  338.         System.out.println (header + "|");

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

  340.         for (int assetIndexI = 0;
  341.             assetIndexI < assetIDArray.length;
  342.             ++assetIndexI)
  343.         {
  344.             String dump = "\t| " + assetIDArray[assetIndexI] + " ";

  345.             for (int assetIndexJ = 0;
  346.                 assetIndexJ < assetIDArray.length;
  347.                 ++assetIndexJ)
  348.             {
  349.                 dump += "|" + FormatUtil.FormatDouble (
  350.                     assetExcessReturnsCovarianceMatrix[assetIndexI][assetIndexJ], 1, 8, 1.
  351.                 ) + " ";
  352.             }

  353.             System.out.println (dump + "||");
  354.         }

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

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

  357.         System.out.println ("\t|                          VIEW SCOPING ASSET PROJECTION LOADING                                 ||");

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

  359.         header = "\t|     |";

  360.         for (int assetIndex = 0;
  361.             assetIndex < assetIDArray.length;
  362.             ++assetIndex)
  363.         {
  364.             header += "    " + assetIDArray[assetIndex] + "     |";
  365.         }

  366.         System.out.println (header + "|");

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

  368.         for (int viewIndex = 0;
  369.             viewIndex < assetSpaceViewProjectionMatrix.length;
  370.             ++viewIndex)
  371.         {
  372.             String dump = "\t|  #" + viewIndex + " ";

  373.             for (int assetIndex = 0;
  374.                 assetIndex < assetIDArray.length;
  375.                 ++assetIndex)
  376.             {
  377.                 dump += "|" + FormatUtil.FormatDouble (
  378.                     assetSpaceViewProjectionMatrix[viewIndex][assetIndex], 1, 8, 1.
  379.                 ) + " ";
  380.             }

  381.             System.out.println (dump + "||");
  382.         }

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

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

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

  386.         for (int viewIndexI = 0;
  387.             viewIndexI < assetSpaceViewProjectionMatrix.length;
  388.             ++viewIndexI)
  389.         {
  390.             String dump = "\t|  #" + viewIndexI + " ";

  391.             for (int viewIndexJ = 0;
  392.                 viewIndexJ < assetSpaceViewProjectionMatrix.length;
  393.                 ++viewIndexJ)
  394.             {
  395.                 dump += "|" + FormatUtil.FormatDouble (
  396.                     projectionExcessReturnsCovarianceMatrix[viewIndexI][viewIndexJ], 1, 8, 1.
  397.                 ) + " ";
  398.             }

  399.             System.out.println (dump + "|" + FormatUtil.FormatDouble (
  400.                 projectionExpectedExcessReturnsArray[viewIndexI], 1, 2, 100.
  401.             ) + "%");
  402.         }

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

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

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

  406.         System.out.println ("\t|                           JOINT CROSS ASSET COVARIANCE MATRIX                                  ||");

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

  408.         header = "\t|     |";

  409.         for (int assetIndex = 0;
  410.             assetIndex < assetIDArray.length;
  411.             ++assetIndex)
  412.         {
  413.             header += "    " + assetIDArray[assetIndex] + "     |";
  414.         }

  415.         System.out.println (header + "|");

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

  417.         for (int assetIndexI = 0;
  418.             assetIndexI < assetIDArray.length;
  419.             ++assetIndexI)
  420.         {
  421.             String dump = "\t| " + assetIDArray[assetIndexI] + " ";

  422.             for (int assetIndexJ = 0;
  423.                 assetIndexJ < assetIDArray.length;
  424.                 ++assetIndexJ)
  425.             {
  426.                 dump += "|" + FormatUtil.FormatDouble (
  427.                     assetSpaceJointCovarianceMatrix[assetIndexI][assetIndexJ], 1, 8, 1.
  428.                 ) + " ";
  429.             }

  430.             System.out.println (dump + "||");
  431.         }

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

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

  434.         System.out.println ("\t|                         POSTERIOR CROSS ASSET COVARIANCE MATRIX                                ||");

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

  436.         header = "\t|     |";

  437.         for (int assetIndex = 0;
  438.             assetIndex < assetIDArray.length;
  439.             ++assetIndex)
  440.         {
  441.             header += "    " + assetIDArray[assetIndex] + "     |";
  442.         }

  443.         System.out.println (header + "|");

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

  445.         for (int assetIndexI = 0; assetIndexI < assetIDArray.length; ++assetIndexI)
  446.         {
  447.             String dump = "\t| " + assetIDArray[assetIndexI] + " ";

  448.             for (int assetIndexJ = 0;
  449.                 assetIndexJ < assetIDArray.length;
  450.                 ++assetIndexJ)
  451.             {
  452.                 dump += "|" + FormatUtil.FormatDouble (
  453.                     assetSpacePosteriorCovarianceMatrix[assetIndexI][assetIndexJ], 1, 8, 1.
  454.                 ) + " ";
  455.             }

  456.             System.out.println (dump + "||");
  457.         }

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

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

  460.         System.out.println ("\t| JOINT/POSTERIOR RETURN ||");

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

  462.         System.out.println ("\t|   ID  => RIOC  | HL99  ||");

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

  464.         for (int assetIndex = 0;
  465.             assetIndex < assetSpaceJointReturnsReconcilerArray.length;
  466.             ++assetIndex)
  467.         {
  468.             System.out.println (
  469.                 "\t| [" + assetIDArray[assetIndex] + "] =>" +
  470.                 FormatUtil.FormatDouble (assetSpaceJointReturnsArray[assetIndex], 2, 1, 100.) + "% |" +
  471.                 FormatUtil.FormatDouble (assetSpaceJointReturnsReconcilerArray[assetIndex], 2, 1, 100.)
  472.                     + "% ||"
  473.             );
  474.         }

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

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

  477.         System.out.println ("\t| OPTIMAL POSTERIOR WTS. ||");

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

  479.         System.out.println ("\t|   ID  => RIOC  | HL99  ||");

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

  481.         for (int assetIndex = 0;
  482.             assetIndex < assetComponentArray.length;
  483.             ++assetIndex)
  484.         {
  485.             System.out.println (
  486.                 "\t| [" + assetIDArray[assetIndex] + "] =>" +
  487.                 FormatUtil.FormatDouble (assetComponentArray[assetIndex].amount(), 2, 1, 100.) + "% |" +
  488.                 FormatUtil.FormatDouble (posteriorOptimalWeightsReconcilerArray[assetIndex], 2, 1, 100.)
  489.                     + "% ||"
  490.             );
  491.         }

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

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

  494.         System.out.println ("\t|   POSTERIOR DEVIATION  ||");

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

  496.         System.out.println ("\t|   ID  => RIOC  | HL99  ||");

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

  498.         for (int assetIndex = 0;
  499.             assetIndex < assetComponentArray.length;
  500.             ++assetIndex)
  501.         {
  502.             System.out.println (
  503.                 "\t| [" + assetIDArray[assetIndex] + "] =>" +
  504.                 FormatUtil.FormatDouble (
  505.                     assetComponentArray[assetIndex].amount() - (assetEquilibriumWeightArray[assetIndex])
  506.                         / (1. + tau), 2, 1, 100.
  507.                 ) + "% |" +
  508.                 FormatUtil.FormatDouble (posteriorOptimalDeviationReconcilerArray[assetIndex], 2, 1, 100.)
  509.                     + "% ||"
  510.             );
  511.         }

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

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

  514.         System.out.println ("\t|              POSTERIOR DEVIATION WEIGHTS ATTRIBUTION            ||");

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

  516.         System.out.println ("\t| VIEW NUM =>  INTRA |  INTER |  PRIOR |  CUMUL |  RECON |  BAYES ||");

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

  518.         for (int viewIndex = 0; viewIndex < interViewComponentArray.length; ++viewIndex)
  519.         {
  520.             System.out.println (
  521.                 "\t| VIEW  #" + (viewIndex + 1) + " => " +
  522.                 FormatUtil.FormatDouble (interViewComponentArray[viewIndex], 1, 3, 1.) + " | " +
  523.                 FormatUtil.FormatDouble (intraViewComponentArray[viewIndex], 1, 3, 1.) + " | " +
  524.                 FormatUtil.FormatDouble (priorViewComponentArray[viewIndex], 1, 3, 1.) + " | " +
  525.                 FormatUtil.FormatDouble (cumulativeViewComponentLoadingArray[viewIndex], 1, 3, 1.) + " | " +
  526.                 FormatUtil.FormatDouble (peLoadingsReconcilerArray[viewIndex], 1, 3, 1.) + " | " +
  527.                 FormatUtil.FormatDouble (
  528.                     cumulativeViewComponentLoadingArray[viewIndex] / (1. + tau), 1, 3, 1.
  529.                 ) + " ||"
  530.             );
  531.         }

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

  533.         EnvManager.TerminateEnv();
  534.     }
  535. }