TadonkiVialHoldingsAllocation.java

  1. package org.drip.portfolioconstruction.cardinality;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

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

  73. /**
  74.  * <i>TadonkiVialHoldingsAllocation</i> holds the Results of the Allocation performed using the Tadonki and
  75.  *  Vial (2004) Heuristic Scheme. The References are:
  76.  *
  77.  * <br><br>
  78.  *  <ul>
  79.  *      <li>
  80.  *          Chang, T., J., N. Meade, J. E. Beasley, and Y. M. Sharaiha (2000): Heuristics for Cardinality
  81.  *              Constrained Portfolio Optimization <i>Computers and Operations Research</i> <b>27 (13)</b>
  82.  *              1271-1302
  83.  *      </li>
  84.  *      <li>
  85.  *          Chvatal, V. (1973): Edmonds Polytopes in a Hierarchy of Combinatorial Problems <i>Discrete
  86.  *              Mathematics</i> <b>4 (4)</b> 305-337
  87.  *      </li>
  88.  *      <li>
  89.  *          Jobst, N. J., M. D. Horniman, C. A. Lucas, and G. Mitra (2001): Computational Aspects of
  90.  *              Alternative Portfolio Selection Models in the Presence of Discrete Asset Choice Constraints
  91.  *              <i>Quantitative Finance</i> <b>1 (5)</b> 1-13
  92.  *      </li>
  93.  *      <li>
  94.  *          Letchford, A. N. and A. Lodi (2002): Strengthening Chvatal-Gomory Cuts and Gomory Fractional Cuts
  95.  *              <i>Operations Research Letters</i> <b>30 (2)</b> 74-82
  96.  *      </li>
  97.  *      <li>
  98.  *          Tadonki, C., and J. P. Vial (2004): Portfolio Selection with Cardinality and Bound Constraints
  99.  *              https://www.cri.ensmp.fr/~tadonki/PaperForWeb/Tadonki_PF.pdf
  100.  *      </li>
  101.  *  </ul>
  102.  *
  103.  *  <br><br>
  104.  *  <ul>
  105.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  106.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AssetAllocationAnalyticsLibrary.md">Asset Allocation Analytics</a></li>
  107.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/portfolioconstruction/README.md">Portfolio Construction under Allocation Constraints</a></li>
  108.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/portfolioconstruction/allocator/README.md">MVO Based Portfolio Allocation Construction</a></li>
  109.  *  </ul>
  110.  *
  111.  * @author Lakshmi Krishnamurthy
  112.  */

  113. public class TadonkiVialHoldingsAllocation
  114.     extends org.drip.portfolioconstruction.allocator.HoldingsAllocation
  115. {
  116.     private org.drip.portfolioconstruction.allocator.HoldingsAllocation _floorPassHoldingsAllocation = null;
  117.     private org.drip.portfolioconstruction.allocator.HoldingsAllocation _firstPrunePassHoldingsAllocation =
  118.         null;
  119.     private org.drip.portfolioconstruction.allocator.HoldingsAllocation _secondPrunePassHoldingsAllocation =
  120.         null;

  121.     /**
  122.      * Generate a Standard Instance of the Tadonki Vial Holdings Allocation
  123.      *
  124.      * @param holdingsAllocation The Holdings Allocation
  125.      *
  126.      * @return Tadonki Vial Holdings Allocation
  127.      */

  128.     public static final TadonkiVialHoldingsAllocation Standard (
  129.         final org.drip.portfolioconstruction.allocator.HoldingsAllocation holdingsAllocation)
  130.     {
  131.         try
  132.         {
  133.             return null == holdingsAllocation ? null :
  134.                 new org.drip.portfolioconstruction.cardinality.TadonkiVialHoldingsAllocation (
  135.                     holdingsAllocation.optimalPortfolio(),
  136.                     holdingsAllocation.optimalMetrics()
  137.                 );
  138.         }
  139.         catch (java.lang.Exception e)
  140.         {
  141.             e.printStackTrace();
  142.         }

  143.         return null;
  144.     }

  145.     /**
  146.      * TadonkiVialHoldingsAllocation Constructor
  147.      *
  148.      * @param optimalPortfolio The Optimal Portfolio
  149.      * @param optimalPortfolioMetrics The Optimal Portfolio Metrics
  150.      *
  151.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  152.      */

  153.     public TadonkiVialHoldingsAllocation (
  154.         final org.drip.portfolioconstruction.asset.Portfolio optimalPortfolio,
  155.         final org.drip.portfolioconstruction.asset.PortfolioMetrics optimalPortfolioMetrics)
  156.         throws java.lang.Exception
  157.     {
  158.         super (
  159.             optimalPortfolio,
  160.             optimalPortfolioMetrics
  161.         );
  162.     }

  163.     /**
  164.      * Retrieve the Floor Pass Holdings Allocation
  165.      *
  166.      * @return The Floor Pass Holdings Allocation
  167.      */

  168.     public org.drip.portfolioconstruction.allocator.HoldingsAllocation floorPassHoldingsAllocation()
  169.     {
  170.         return _floorPassHoldingsAllocation;
  171.     }

  172.     /**
  173.      * Retrieve the First Prune Pass Holdings Allocation
  174.      *
  175.      * @return The First Prune Pass Holdings Allocation
  176.      */

  177.     public org.drip.portfolioconstruction.allocator.HoldingsAllocation firstPrunePassHoldingsAllocation()
  178.     {
  179.         return _firstPrunePassHoldingsAllocation;
  180.     }

  181.     /**
  182.      * Retrieve the Second Prune Pass Holdings Allocation
  183.      *
  184.      * @return The Second Prune Pass Holdings Allocation
  185.      */

  186.     public org.drip.portfolioconstruction.allocator.HoldingsAllocation secondPrunePassHoldingsAllocation()
  187.     {
  188.         return _secondPrunePassHoldingsAllocation;
  189.     }

  190.     /**
  191.      * Set the Floor Pass Holdings Allocation
  192.      *
  193.      * @param floorPassHoldingsAllocation The Floor Pass Holdings Allocation
  194.      *
  195.      * @return TRUE - The Floor Pass Holdings Allocation successfully set
  196.      */

  197.     public boolean setFloorPassHoldingsAllocation (
  198.         final org.drip.portfolioconstruction.allocator.HoldingsAllocation floorPassHoldingsAllocation)
  199.     {
  200.         if (null == floorPassHoldingsAllocation)
  201.         {
  202.             return false;
  203.         }

  204.         _floorPassHoldingsAllocation = floorPassHoldingsAllocation;
  205.         return true;
  206.     }

  207.     /**
  208.      * Set the First Prune Pass Holdings Allocation
  209.      *
  210.      * @param firstPrunePassHoldingsAllocation The First Prune Pass Holdings Allocation
  211.      *
  212.      * @return TRUE - The First Prune Pass Holdings Allocation successfully set
  213.      */

  214.     public boolean setFirstPrunePassHoldingsAllocation (
  215.         final org.drip.portfolioconstruction.allocator.HoldingsAllocation firstPrunePassHoldingsAllocation)
  216.     {
  217.         if (null == firstPrunePassHoldingsAllocation)
  218.         {
  219.             return false;
  220.         }

  221.         _firstPrunePassHoldingsAllocation = firstPrunePassHoldingsAllocation;
  222.         return true;
  223.     }

  224.     /**
  225.      * Set the Second Prune Pass Holdings Allocation
  226.      *
  227.      * @param secondPrunePassHoldingsAllocation The Second Prune Pass Holdings Allocation
  228.      *
  229.      * @return TRUE - The Second Prune Pass Holdings Allocation successfully set
  230.      */

  231.     public boolean setSecondPrunePassHoldingsAllocation (
  232.         final org.drip.portfolioconstruction.allocator.HoldingsAllocation secondPrunePassHoldingsAllocation)
  233.     {
  234.         if (null == secondPrunePassHoldingsAllocation)
  235.         {
  236.             return false;
  237.         }

  238.         _secondPrunePassHoldingsAllocation = secondPrunePassHoldingsAllocation;
  239.         return true;
  240.     }
  241. }