Account.java

  1. package org.drip.portfolioconstruction.core;

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

  5. /*!
  6.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  7.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  8.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  9.  * Copyright (C) 2017 Lakshmi Krishnamurthy
  10.  *
  11.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  12.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  13.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  14.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  15.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  16.  *      and computational support.
  17.  *  
  18.  *      https://lakshmidrip.github.io/DROP/
  19.  *  
  20.  *  DROP is composed of three modules:
  21.  *  
  22.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  23.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  24.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  25.  *
  26.  *  DROP Product Core implements libraries for the following:
  27.  *  - Fixed Income Analytics
  28.  *  - Loan Analytics
  29.  *  - Transaction Cost Analytics
  30.  *
  31.  *  DROP Portfolio Core implements libraries for the following:
  32.  *  - Asset Allocation Analytics
  33.  *  - Asset Liability Management Analytics
  34.  *  - Capital Estimation Analytics
  35.  *  - Exposure Analytics
  36.  *  - Margin Analytics
  37.  *  - XVA Analytics
  38.  *
  39.  *  DROP Computational Core implements libraries for the following:
  40.  *  - Algorithm Support
  41.  *  - Computation Support
  42.  *  - Function Analysis
  43.  *  - Model Validation
  44.  *  - Numerical Analysis
  45.  *  - Numerical Optimizer
  46.  *  - Spline Builder
  47.  *  - Statistical Learning
  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>Account</i> holds the Current Portfolio (if any) along with the Creation/Maintenance Mandate.
  78.  *
  79.  *  <br><br>
  80.  *  <ul>
  81.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  82.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AssetAllocationAnalyticsLibrary.md">Asset Allocation Analytics</a></li>
  83.  *      <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>
  84.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/portfolioconstruction/core/README.md">Core Portfolio Construction Component Suite</a></li>
  85.  *  </ul>
  86.  * <br><br>
  87.  *
  88.  * @author Lakshmi Krishnamurthy
  89.  */

  90. public class Account
  91.     extends org.drip.portfolioconstruction.core.Block
  92. {
  93.     private org.drip.portfolioconstruction.composite.Holdings _holdings = null;
  94.     private org.drip.portfolioconstruction.composite.AlphaGroup _alphaGroup = null;
  95.     private org.drip.portfolioconstruction.composite.Benchmark _trackingBenchmark = null;
  96.     private org.drip.portfolioconstruction.composite.Benchmark _objectiveBenchmark = null;
  97.     private org.drip.portfolioconstruction.core.TaxAccountingScheme _taxAccountingScheme = null;
  98.     private org.drip.portfolioconstruction.risk.AssetCovariance _assetCovarianceRiskModel = null;
  99.     private org.drip.portfolioconstruction.risk.AlphaUncertaintyGroup _alphaUncertaintyGroup = null;
  100.     private org.drip.portfolioconstruction.composite.TransactionChargeGroup _transactionChargeGroup = null;

  101.     /**
  102.      * Account Constructor
  103.      *
  104.      * @param name The Account Name
  105.      * @param id The Account ID
  106.      * @param description The Account Description
  107.      * @param holdings The Account Holdings
  108.      * @param taxAccountingScheme The Tax Accounting Scheme
  109.      *
  110.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  111.      */

  112.     public Account (
  113.         final java.lang.String name,
  114.         final java.lang.String id,
  115.         final java.lang.String description,
  116.         final org.drip.portfolioconstruction.composite.Holdings holdings,
  117.         final org.drip.portfolioconstruction.core.TaxAccountingScheme taxAccountingScheme)
  118.         throws java.lang.Exception
  119.     {
  120.         super (
  121.             name,
  122.             id,
  123.             description
  124.         );

  125.         _holdings = holdings;
  126.         _taxAccountingScheme = taxAccountingScheme;
  127.     }

  128.     /**
  129.      * Retrieve the Holdings
  130.      *
  131.      * @return The Holdings
  132.      */

  133.     public org.drip.portfolioconstruction.composite.Holdings holdings()
  134.     {
  135.         return _holdings;
  136.     }

  137.     /**
  138.      * Retrieve the Currency
  139.      *
  140.      * @return The Currency
  141.      */

  142.     public java.lang.String currency()
  143.     {
  144.         return _holdings.currency();
  145.     }

  146.     /**
  147.      * Retrieve the Tracking Benchmark Instance
  148.      *
  149.      * @return The Tracking Benchmark Instance
  150.      */

  151.     public org.drip.portfolioconstruction.composite.Benchmark trackingBenchmark()
  152.     {
  153.         return _trackingBenchmark;
  154.     }

  155.     /**
  156.      * Retrieve the Objective Benchmark Instance
  157.      *
  158.      * @return The Objective Benchmark Instance
  159.      */

  160.     public org.drip.portfolioconstruction.composite.Benchmark objectiveBenchmark()
  161.     {
  162.         return _objectiveBenchmark;
  163.     }

  164.     /**
  165.      * Retrieve the Alpha Group Instance
  166.      *
  167.      * @return The Alpha Group Instance
  168.      */

  169.     public org.drip.portfolioconstruction.composite.AlphaGroup alphaGroup()
  170.     {
  171.         return _alphaGroup;
  172.     }

  173.     /**
  174.      * Retrieve the Alpha Uncertainty Group Instance
  175.      *
  176.      * @return The Alpha Uncertainty Group Instance
  177.      */

  178.     public org.drip.portfolioconstruction.risk.AlphaUncertaintyGroup alphaUncertaintyGroup()
  179.     {
  180.         return _alphaUncertaintyGroup;
  181.     }

  182.     /**
  183.      * Retrieve the Asset Co-variance Risk Model
  184.      *
  185.      * @return The Asset Co-variance Risk Model
  186.      */

  187.     public org.drip.portfolioconstruction.risk.AssetCovariance assetCovariance()
  188.     {
  189.         return _assetCovarianceRiskModel;
  190.     }

  191.     /**
  192.      * Retrieve the Transaction Cost Group Instance
  193.      *
  194.      * @return The Transaction Cost Group Instance
  195.      */

  196.     public org.drip.portfolioconstruction.composite.TransactionChargeGroup transactionChargeGroup()
  197.     {
  198.         return _transactionChargeGroup;
  199.     }

  200.     /**
  201.      * Retrieve the Tax Accounting Scheme
  202.      *
  203.      * @return The Tax Accounting Scheme
  204.      */

  205.     public org.drip.portfolioconstruction.core.TaxAccountingScheme taxAccountingScheme()
  206.     {
  207.         return _taxAccountingScheme;
  208.     }

  209.     /**
  210.      * Set the Tracking Benchmark Instance
  211.      *
  212.      * @param trackingBenchmark The Tracking Benchmark
  213.      *
  214.      * @return The Tracking Benchmark successfully set
  215.      */

  216.     public boolean setTrackingBenchmark (
  217.         final org.drip.portfolioconstruction.composite.Benchmark trackingBenchmark)
  218.     {
  219.         if (null == trackingBenchmark)
  220.         {
  221.             return false;
  222.         }

  223.         _trackingBenchmark = trackingBenchmark;
  224.         return true;
  225.     }

  226.     /**
  227.      * Set the Objective Benchmark Instance
  228.      *
  229.      * @param objectiveBenchmark The Objective Benchmark
  230.      *
  231.      * @return The Objective Benchmark successfully set
  232.      */

  233.     public boolean setObjectiveBenchmark (
  234.         final org.drip.portfolioconstruction.composite.Benchmark objectiveBenchmark)
  235.     {
  236.         if (null == objectiveBenchmark)
  237.         {
  238.             return false;
  239.         }

  240.         _objectiveBenchmark = objectiveBenchmark;
  241.         return true;
  242.     }

  243.     /**
  244.      * Set the Alpha Group
  245.      *
  246.      * @param alphaGroup The Alpha Group Instance
  247.      *
  248.      * @return The Alpha Group successfully set
  249.      */

  250.     public boolean setAlphaGroup (
  251.         final org.drip.portfolioconstruction.composite.AlphaGroup alphaGroup)
  252.     {
  253.         if (null == alphaGroup)
  254.         {
  255.             return false;
  256.         }

  257.         _alphaGroup = alphaGroup;
  258.         return true;
  259.     }

  260.     /**
  261.      * Set the Alpha Uncertainty Group
  262.      *
  263.      * @param alphaUncertaintyGroup The Alpha Uncertainty Group Instance
  264.      *
  265.      * @return The Alpha Uncertainty Group successfully set
  266.      */

  267.     public boolean setAlphaUncertaintyGroup (
  268.         final org.drip.portfolioconstruction.risk.AlphaUncertaintyGroup alphaUncertaintyGroup)
  269.     {
  270.         if (null == alphaUncertaintyGroup)
  271.         {
  272.             return false;
  273.         }

  274.         _alphaUncertaintyGroup = alphaUncertaintyGroup;
  275.         return true;
  276.     }

  277.     /**
  278.      * Set the Asset Co-variance Risk Model
  279.      *
  280.      * @param assetCovarianceRiskModel The Asset Co-variance Risk Model
  281.      *
  282.      * @return The Asset Co-variance Risk Model
  283.      */

  284.     public boolean setAssetCovariance (
  285.         final org.drip.portfolioconstruction.risk.AssetCovariance assetCovarianceRiskModel)
  286.     {
  287.         if (null == assetCovarianceRiskModel)
  288.         {
  289.             return false;
  290.         }

  291.         _assetCovarianceRiskModel = assetCovarianceRiskModel;
  292.         return true;
  293.     }

  294.     /**
  295.      * Set the Transaction Cost Group
  296.      *
  297.      * @param transactionChargeGroup The Transaction Cost Group Instance
  298.      *
  299.      * @return The Transaction Cost Group successfully set
  300.      */

  301.     public boolean setTransactionCostGroup (
  302.         final org.drip.portfolioconstruction.composite.TransactionChargeGroup transactionChargeGroup)
  303.     {
  304.         if (null == transactionChargeGroup)
  305.         {
  306.             return false;
  307.         }

  308.         _transactionChargeGroup = transactionChargeGroup;
  309.         return true;
  310.     }
  311. }