CoveringNumberBoundBuilder.java

  1. package org.drip.learning.bound;

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

  78. /**
  79.  * <i>CoveringNumberBoundBuilder</i> constructs the CoveringNumberProbabilityBound Instances for specific
  80.  * Learning Situations. The References are:
  81.  * <br><br>
  82.  * <ul>
  83.  *  <li>
  84.  *      Alon, N., S. Ben-David, N. Cesa Bianchi, and D. Haussler (1997): Scale-sensitive Dimensions, Uniform
  85.  *          Convergence, and Learnability <i>Journal of Association of Computational Machinery</i> <b>44
  86.  *          (4)</b> 615-631
  87.  *  </li>
  88.  *  <li>
  89.  *      Anthony, M., and P. L. Bartlett (1999): <i>Artificial Neural Network Learning - Theoretical
  90.  *          Foundations</i> <b>Cambridge University Press</b> Cambridge, UK
  91.  *  </li>
  92.  *  <li>
  93.  *      Kearns, M. J., R. E. Schapire, and L. M. Sellie (1994): <i>Towards Efficient Agnostic Learning</i>
  94.  *          Machine Learning <b>17 (2)</b> 115-141
  95.  *  </li>
  96.  *  <li>
  97.  *      Lee, W. S., P. L. Bartlett, and R. C. Williamson (1998): The Importance of Convexity in Learning with
  98.  *          Squared Loss <i>IEEE Transactions on Information Theory</i> <b>44</b> 1974-1980
  99.  *  </li>
  100.  *  <li>
  101.  *      Vapnik, V. N. (1998): <i>Statistical learning Theory</i> <b>Wiley</b> New York
  102.  *  </li>
  103.  * </ul>
  104.  *
  105.  *  <br><br>
  106.  *  <ul>
  107.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
  108.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/StatisticalLearningLibrary.md">Statistical Learning</a></li>
  109.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/learning">Agnostic Learning Bounds under Empirical Loss Minimization Schemes</a></li>
  110.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/learning/bound">Covering Numbers, Concentration, Lipschitz Bounds</a></li>
  111.  *  </ul>
  112.  *
  113.  * @author Lakshmi Krishnamurthy
  114.  */

  115. public class CoveringNumberBoundBuilder {

  116.     /**
  117.      * Epsilon Exponent for Regression Learning
  118.      */

  119.     public static final double EPSILON_EXPONENT_REGRESSION_LEARNING = 1.;

  120.     /**
  121.      * Epsilon Exponent for Agnostic Learning
  122.      */

  123.     public static final double EPSILON_EXPONENT_AGNOSTIC_LEARNING = 2.;

  124.     /**
  125.      * Epsilon Exponent for Agnostic Learning with Convex Functions
  126.      */

  127.     public static final double EPSILON_EXPONENT_AGNOSTIC_CONVEX_LEARNING = 1.;

  128.     /**
  129.      * Construct the Regression Learning CoveringNumberProbabilityBound Instance
  130.      *
  131.      * @param funcSampleCoefficient The Sample Coefficient Function
  132.      * @param dblExponentScaler The Exponent Scaler
  133.      *
  134.      * @return The Regression Learning CoveringNumberProbabilityBound Instance
  135.      */

  136.     public static final org.drip.learning.bound.CoveringNumberLossBound
  137.         RegressionLearning (
  138.             final org.drip.function.definition.R1ToR1 funcSampleCoefficient,
  139.             final double dblExponentScaler)
  140.     {
  141.         try {
  142.             return new org.drip.learning.bound.CoveringNumberLossBound (funcSampleCoefficient,
  143.                 EPSILON_EXPONENT_REGRESSION_LEARNING, dblExponentScaler);
  144.         } catch (java.lang.Exception e) {
  145.             e.printStackTrace();
  146.         }

  147.         return null;
  148.     }

  149.     /**
  150.      * Construct the Agnostic Learning CoveringNumberProbabilityBound Instance
  151.      *
  152.      * @param funcSampleCoefficient The Sample Coefficient Function
  153.      * @param dblExponentScaler The Exponent Scaler
  154.      *
  155.      * @return The Agnostic Learning CoveringNumberProbabilityBound Instance
  156.      */

  157.     public static final org.drip.learning.bound.CoveringNumberLossBound
  158.         AgnosticLearning (
  159.             final org.drip.function.definition.R1ToR1 funcSampleCoefficient,
  160.             final double dblExponentScaler)
  161.     {
  162.         try {
  163.             return new org.drip.learning.bound.CoveringNumberLossBound (funcSampleCoefficient,
  164.                 EPSILON_EXPONENT_AGNOSTIC_LEARNING, dblExponentScaler);
  165.         } catch (java.lang.Exception e) {
  166.             e.printStackTrace();
  167.         }

  168.         return null;
  169.     }

  170.     /**
  171.      * Construct the Agnostic Convex Learning CoveringNumberProbabilityBound Instance
  172.      *
  173.      * @param funcSampleCoefficient The Sample Coefficient Function
  174.      * @param dblExponentScaler The Exponent Scaler
  175.      *
  176.      * @return The Agnostic Convex Learning CoveringNumberProbabilityBound Instance
  177.      */

  178.     public static final org.drip.learning.bound.CoveringNumberLossBound
  179.         AgnosticConvexLearning (
  180.             final org.drip.function.definition.R1ToR1 funcSampleCoefficient,
  181.             final double dblExponentScaler)
  182.     {
  183.         try {
  184.             return new org.drip.learning.bound.CoveringNumberLossBound (funcSampleCoefficient,
  185.                 EPSILON_EXPONENT_AGNOSTIC_CONVEX_LEARNING, dblExponentScaler);
  186.         } catch (java.lang.Exception e) {
  187.             e.printStackTrace();
  188.         }

  189.         return null;
  190.     }
  191. }