Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
Bug Fixes/Re-organization:

	- Special Function Incomplete Gamma Limit Asymptote - Constructor (1)
	- Special Function Incomplete Gamma Limit Asymptote - Z Zero (2)
	- Special Function Incomplete Gamma Limit Asymptote - Z Infinity (3)
	- Special Function Incomplete Gamma Lower Euler Integral (4, 5, 6)
	- Special Function Incomplete Gamma Lower Euler Integral - Limit (7, 8)
	- Special Function Incomplete Gamma Lower Euler Integral - Constructor (9, 10)
	- Special Function Incomplete Gamma Lower Euler Integral - Evaluate (11, 12, 13)
	- Special Function Incomplete Gamma Lower Limit Power Integrand (14, 15, 16)
	- Special Function Incomplete Gamma Lower Limit Power Integrand - s (17, 18)
	- Special Function Incomplete Gamma Lower Limit Power Integrand - Exponent (19, 20)
	- Special Function Incomplete Gamma Lower Limit Power Integrand - Constructor (21, 22)
	- Special Function Incomplete Gamma Lower Limit Power Integrand - Evaluate (23, 24)
	- Special Function Incomplete Gamma Lower Limit Power Integrand - Anti-derivative (25, 26, 27)
	- Special Function Incomplete Gamma Lower Limit Power Integrand - Evaluate (28, 29)
	- Special Function Incomplete Gamma Upper Euler Integral (30, 31, 32)
	- Special Function Incomplete Gamma Upper Euler Integral - Limit (33, 34)
	- Special Function Incomplete Gamma Upper Euler Integral - Constructor (35, 36)
	- Special Function Incomplete Gamma Upper Euler Integral - Evaluate (37, 38, 39)


Samples:

IdeaDRIP:

	- Regression for Curreny Returns (Results in Exhibits 2.18-2.20) (40-46)
	- A Short-List of Risk Factors of a Top-down Asset Allocation Exercise (47-60)
  • Loading branch information
Lakshmik committed Feb 27, 2024
1 parent c0937c5 commit 18145ad
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 118 deletions.
31 changes: 31 additions & 0 deletions ReleaseNotes/08_01_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Features:

Bug Fixes/Re-organization:

- Special Function Incomplete Gamma Limit Asymptote - Constructor (1)
- Special Function Incomplete Gamma Limit Asymptote - Z Zero (2)
- Special Function Incomplete Gamma Limit Asymptote - Z Infinity (3)
- Special Function Incomplete Gamma Lower Euler Integral (4, 5, 6)
- Special Function Incomplete Gamma Lower Euler Integral - Limit (7, 8)
- Special Function Incomplete Gamma Lower Euler Integral - Constructor (9, 10)
- Special Function Incomplete Gamma Lower Euler Integral - Evaluate (11, 12, 13)
- Special Function Incomplete Gamma Lower Limit Power Integrand (14, 15, 16)
- Special Function Incomplete Gamma Lower Limit Power Integrand - s (17, 18)
- Special Function Incomplete Gamma Lower Limit Power Integrand - Exponent (19, 20)
- Special Function Incomplete Gamma Lower Limit Power Integrand - Constructor (21, 22)
- Special Function Incomplete Gamma Lower Limit Power Integrand - Evaluate (23, 24)
- Special Function Incomplete Gamma Lower Limit Power Integrand - Anti-derivative (25, 26, 27)
- Special Function Incomplete Gamma Lower Limit Power Integrand - Evaluate (28, 29)
- Special Function Incomplete Gamma Upper Euler Integral (30, 31, 32)
- Special Function Incomplete Gamma Upper Euler Integral - Limit (33, 34)
- Special Function Incomplete Gamma Upper Euler Integral - Constructor (35, 36)
- Special Function Incomplete Gamma Upper Euler Integral - Evaluate (37, 38, 39)


Samples:

IdeaDRIP:

- Regression for Curreny Returns (Results in Exhibits 2.18-2.20) (40-46)
- A Short-List of Risk Factors of a Top-down Asset Allocation Exercise (47-60)
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@

package org.drip.specialfunction.incompletegamma;

import org.drip.function.definition.R1ToR1;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.differentiation.DerivativeControl;
import org.drip.numerical.integration.NewtonCotesQuadratureGenerator;

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

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -78,7 +86,7 @@

/**
* <i>LowerEulerIntegral</i> implements the Euler's Second Kind Integral Version of the Lower Incomplete
* Gamma Function. The References are:
* Gamma Function. The References are:
*
* <br><br>
* <ul>
Expand All @@ -105,41 +113,53 @@
* https://en.wikipedia.org/wiki/Incomplete_gamma_function
* </li>
* </ul>
*
* It provides the following functionality:
*
* <br><br>
* <ul>
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FunctionAnalysisLibrary.md">Function Analysis Library</a></li>
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/README.md">Special Function Implementation Analysis</a></li>
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/gammaincomplete/README.md">Upper/Lower Incomplete Gamma Functions</a></li>
* <li><i>LowerEulerIntegral</i> Constructor</li>
* <li>Retrieve the Upper Limit</li>
* </ul>
*
* <br>
* <style>table, td, th {
* padding: 1px; border: 2px solid #008000; border-radius: 8px; background-color: #dfff00;
* text-align: center; color: #0000ff;
* }
* </style>
*
* <table style="border:1px solid black;margin-left:auto;margin-right:auto;">
* <tr><td><b>Module </b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></td></tr>
* <tr><td><b>Library</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FunctionAnalysisLibrary.md">Function Analysis Library</a></td></tr>
* <tr><td><b>Project</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/README.md">Special Function Implementation and Analysis</a></td></tr>
* <tr><td><b>Package</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/incompletegamma/README.md">Upper/Lower Incomplete Gamma Functions</a></td></tr>
* </table>
*
* @author Lakshmi Krishnamurthy
*/

public class LowerEulerIntegral extends org.drip.function.definition.R1ToR1
public class LowerEulerIntegral extends R1ToR1
{
private double _limit = java.lang.Double.NaN;
private double _limit = Double.NaN;

/**
* LowerEulerIntegral Constructor
* <i>LowerEulerIntegral</i> Constructor
*
* @param limit The Upper Limit
* @param dc The Derivative Control
* @param derivativeControl The Derivative Control
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
* @throws Exception Thrown if the Inputs are Invalid
*/

public LowerEulerIntegral (
final org.drip.numerical.differentiation.DerivativeControl dc,
final DerivativeControl derivativeControl,
final double limit)
throws java.lang.Exception
throws Exception
{
super (dc);
super (derivativeControl);

if (!org.drip.numerical.common.NumberUtil.IsValid (_limit = limit))
{
throw new java.lang.Exception ("LowerEulerIntegral Constructor => Invalid Inputs");
if (!NumberUtil.IsValid (_limit = limit)) {
throw new Exception ("LowerEulerIntegral Constructor => Invalid Inputs");
}
}

Expand All @@ -156,30 +176,19 @@ public double limit()

@Override public double evaluate (
final double s)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (s))
{
throw new java.lang.Exception ("LowerEulerIntegral::evaluate => Invalid Inputs");
if (!NumberUtil.IsValid (s)) {
throw new Exception ("LowerEulerIntegral::evaluate => Invalid Inputs");
}

return org.drip.numerical.integration.NewtonCotesQuadratureGenerator.Zero_PlusOne (
0.,
_limit,
10000
).integrate (
new org.drip.function.definition.R1ToR1 (null)
{
return NewtonCotesQuadratureGenerator.Zero_PlusOne (0., _limit, 10000).integrate (
new R1ToR1 (null) {
@Override public double evaluate (
final double t)
throws java.lang.Exception
throws Exception
{
return java.lang.Double.isInfinite (t) ? 0. : (0 == t ? 1. :
java.lang.Math.pow (
t,
s - 1
)
) * java.lang.Math.exp (-t);
return Double.isInfinite (t) ? 0. : (0 == t ? 1. : Math.pow (t, s - 1)) * Math.exp (-t);
}
}
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@

package org.drip.specialfunction.incompletegamma;

import org.drip.function.definition.R1ToR1;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.differentiation.DerivativeControl;

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

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -78,7 +85,7 @@

/**
* <i>LowerLimitPowerIntegrand</i> contains the Integrand that is the Product of the Limit raised to a Power
* Exponent and the corresponding Lower Incomplete Gamma, for a given s. The References are:
* Exponent and the corresponding Lower Incomplete Gamma, for a given s. The References are:
*
* <br><br>
* <ul>
Expand All @@ -105,46 +112,60 @@
* https://en.wikipedia.org/wiki/Incomplete_gamma_function
* </li>
* </ul>
*
* It provides the following functionality:
*
* <br><br>
* <ul>
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FunctionAnalysisLibrary.md">Function Analysis Library</a></li>
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/README.md">Special Function Implementation Analysis</a></li>
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/gammaincomplete/README.md">Upper/Lower Incomplete Gamma Functions</a></li>
* <li><i>LowerLimitPowerIntegrand</i> Constructor</li>
* <li>Retrieve s</li>
* <li>Retrieve the Limit Power Exponent</li>
* </ul>
*
* <br>
* <style>table, td, th {
* padding: 1px; border: 2px solid #008000; border-radius: 8px; background-color: #dfff00;
* text-align: center; color: #0000ff;
* }
* </style>
*
* <table style="border:1px solid black;margin-left:auto;margin-right:auto;">
* <tr><td><b>Module </b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></td></tr>
* <tr><td><b>Library</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FunctionAnalysisLibrary.md">Function Analysis Library</a></td></tr>
* <tr><td><b>Project</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/README.md">Special Function Implementation and Analysis</a></td></tr>
* <tr><td><b>Package</b></td> <td><a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/incompletegamma/README.md">Upper/Lower Incomplete Gamma Functions</a></td></tr>
* </table>
*
* @author Lakshmi Krishnamurthy
*/

public class LowerLimitPowerIntegrand extends org.drip.function.definition.R1ToR1
public class LowerLimitPowerIntegrand extends R1ToR1
{
private double _s = java.lang.Double.NaN;
private double _limitExponent = java.lang.Double.NaN;
private double _s = Double.NaN;
private double _limitExponent = Double.NaN;

/**
* LowerLimitPowerIntegrand Constructor
* <i>LowerLimitPowerIntegrand</i> Constructor
*
* @param dc The Derivative Control
* @param derivativeControl The Derivative Control
* @param s s
* @param limitExponent The Limit Power Exponent
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
* @throws Exception Thrown if the Inputs are Invalid
*/

public LowerLimitPowerIntegrand (
final org.drip.numerical.differentiation.DerivativeControl dc,
final DerivativeControl derivativeControl,
final double s,
final double limitExponent)
throws java.lang.Exception
throws Exception
{
super (dc);
super (derivativeControl);

if (!org.drip.numerical.common.NumberUtil.IsValid (_s = s) ||
!org.drip.numerical.common.NumberUtil.IsValid (_limitExponent = limitExponent) ||
1. >= _limitExponent)
if (!NumberUtil.IsValid (_s = s) ||
!NumberUtil.IsValid (_limitExponent = limitExponent) ||
1. >= _limitExponent)
{
throw new java.lang.Exception ("LowerLimitPowerIntegrand Constructor => Invalid Inputs");
throw new Exception ("LowerLimitPowerIntegrand Constructor => Invalid Inputs");
}
}

Expand Down Expand Up @@ -172,48 +193,31 @@ public double limitExponent()

@Override public double evaluate (
final double z)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (z))
{
throw new java.lang.Exception ("LowerLimitPowerIntegrand::evaluate => Invalid Inputs");
if (!NumberUtil.IsValid (z)) {
throw new Exception ("LowerLimitPowerIntegrand::evaluate => Invalid Inputs");
}

return java.lang.Math.pow (
z,
_limitExponent - 1.
) * new org.drip.specialfunction.incompletegamma.LowerEulerIntegral (
null,
z
).evaluate (_s);
return Math.pow (z, _limitExponent - 1.) * new LowerEulerIntegral (null, z).evaluate (_s);
}

@Override public org.drip.function.definition.R1ToR1 antiDerivative()
@Override public R1ToR1 antiDerivative()
{
return new org.drip.function.definition.R1ToR1 (null)
{
return new R1ToR1 (null) {
@Override public double evaluate (
final double z)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (z))
{
throw new java.lang.Exception
("LowerLimitPowerIntegrand::antiDerivative::evaluate => Invalid Inputs");
if (!NumberUtil.IsValid (z)) {
throw new Exception (
"LowerLimitPowerIntegrand::antiDerivative::evaluate => Invalid Inputs"
);
}

return (
java.lang.Math.pow (
z,
_limitExponent
) * new org.drip.specialfunction.incompletegamma.LowerEulerIntegral (
null,
z
).evaluate (_s) +
new org.drip.specialfunction.incompletegamma.UpperEulerIntegral (
null,
z
).evaluate (_s + _limitExponent)
Math.pow (z, _limitExponent) * new LowerEulerIntegral (null, z).evaluate (_s) +
new UpperEulerIntegral (null, z).evaluate (_s + _limitExponent)
) / _limitExponent;
}
};
Expand All @@ -222,9 +226,9 @@ public double limitExponent()
@Override public double integrate (
final double left,
final double right)
throws java.lang.Exception
throws Exception
{
org.drip.function.definition.R1ToR1 antiDerivative = antiDerivative();
R1ToR1 antiDerivative = antiDerivative();

return antiDerivative.evaluate (right) - antiDerivative.evaluate (left);
}
Expand Down
Loading

0 comments on commit 18145ad

Please sign in to comment.