Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Riskless Units Function Reservation Pricer (11, 12, 13)
	- OMS Indifference Inventory Utility Expectation (14, 15, 16)
	- Inventory Utility Expectation Underlier Units (17, 18, 19)
	- Inventory Utility Expectation Objective Function (20, 21)
	- Inventory Bid Ask Claims Handler (22, 23, 24)
	- Inventory Utility Reservation Function #1 (25, 26, 27)
	- Inventory Utility Reservation Function #2 (28, 29, 30)
	- Inventory Utility Reservation Function #3 (31, 32, 33)
	- OMS Indifference Reservation Pricer #1 (34, 35, 36)
	- OMS Indifference Reservation Pricer #2 (37)
	- Reservation Pricer Inventory Utility Expectation #1 (38, 39, 40)
	- Reservation Pricer Process Shell Flow (41, 42, 43)
	- Reservation Pricer Baseline Indifference Function (44, 45, 46)
	- Reservation Pricer Inventory Utility Expectation #2 (47, 48)
	- Reservation Pricer Process Shell Instance (50, 51)
	- Reservation Pricer Baseline Indifference Function (52, 53, 54)
	- Reservation Optimal Baseline Underlier Units (55, 56)
	- Reservation Pricer Baseline Flow #1 (57, 58)
	- Reservation Pricer Baseline Flow #2 (59, 60)


Bug Fixes/Re-organization:

	- Special Function Bessel Spherical Second Estimator - Constructor (1, 2)
	- Special Function Bessel Spherical Second Estimator - Order Plus Three (3, 4)
	- Special Function Bessel Spherical Second Estimator - Order Plus Two (5, 6)
	- Special Function Bessel Spherical Second Estimator - Order Plus Two (5, 6)
	- Special Function Bessel Spherical Second Estimator - Order Zero (9, 10)
	- Rename Reservation Price to Pricer (49)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Jan 21, 2024
1 parent 9d6ebef commit 1de1193
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 204 deletions.
37 changes: 37 additions & 0 deletions ReleaseNotes/05_24_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Features:

- Riskless Units Function Reservation Pricer (11, 12, 13)
- OMS Indifference Inventory Utility Expectation (14, 15, 16)
- Inventory Utility Expectation Underlier Units (17, 18, 19)
- Inventory Utility Expectation Objective Function (20, 21)
- Inventory Bid Ask Claims Handler (22, 23, 24)
- Inventory Utility Reservation Function #1 (25, 26, 27)
- Inventory Utility Reservation Function #2 (28, 29, 30)
- Inventory Utility Reservation Function #3 (31, 32, 33)
- OMS Indifference Reservation Pricer #1 (34, 35, 36)
- OMS Indifference Reservation Pricer #2 (37)
- Reservation Pricer Inventory Utility Expectation #1 (38, 39, 40)
- Reservation Pricer Process Shell Flow (41, 42, 43)
- Reservation Pricer Baseline Indifference Function (44, 45, 46)
- Reservation Pricer Inventory Utility Expectation #2 (47, 48)
- Reservation Pricer Process Shell Instance (50, 51)
- Reservation Pricer Baseline Indifference Function (52, 53, 54)
- Reservation Optimal Baseline Underlier Units (55, 56)
- Reservation Pricer Baseline Flow #1 (57, 58)
- Reservation Pricer Baseline Flow #2 (59, 60)


Bug Fixes/Re-organization:

- Special Function Bessel Spherical Second Estimator - Constructor (1, 2)
- Special Function Bessel Spherical Second Estimator - Order Plus Three (3, 4)
- Special Function Bessel Spherical Second Estimator - Order Plus Two (5, 6)
- Special Function Bessel Spherical Second Estimator - Order Plus Two (5, 6)
- Special Function Bessel Spherical Second Estimator - Order Zero (9, 10)
- Rename Reservation Price to Pricer (49)


Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
194 changes: 34 additions & 160 deletions src/main/java/org/drip/oms/indifference/ReservationPricer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import org.drip.function.definition.R1ToR1;
import org.drip.measure.continuous.R1Univariate;
import org.drip.measure.discrete.R1Distribution;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.integration.R1ToR1Integrator;

Expand Down Expand Up @@ -80,7 +79,8 @@
*/

/**
* <i>ReservationPricer</i> holds the main Private Reservation Pricer and its Parameters. The References are:
* <i>ReservationPricer</i> implements the Expectation of the Utility Function using Units of Underlying
* Asset. The References are:
*
* <br><br>
* <ul>
Expand Down Expand Up @@ -117,80 +117,18 @@

public class ReservationPricer
{
private double _endowmentValue = Double.NaN;
private R1ToR1 _privateValuationUtilityFunction = null;
private BidAskClaimsHandler _bidAskClaimsHandler = null;

private double expectedTerminalUtilityPrice (
final R1Distribution terminalDistribution)
throws Exception
{
if (null == terminalDistribution)
{
throw new Exception (
"ReservationPricer::expectedTerminalUtilityPrice => Invalid Terminal Distribution"
);
}

double expectedTerminalUtilityPrice = 0.;

for (double terminalInstance : terminalDistribution.probabilityMap().keySet())
{
expectedTerminalUtilityPrice += _privateValuationUtilityFunction.evaluate (terminalInstance) *
terminalDistribution.probability (terminalInstance);
}

return expectedTerminalUtilityPrice;
}

public double expectedTerminalUtilityPrice (
final R1Univariate terminalDistribution)
throws Exception
{
if (null == terminalDistribution)
{
throw new Exception (
"ReservationPricer::expectedTerminalUtilityPrice => Invalid Terminal Distribution"
);
}

double[] terminalSupportArray = terminalDistribution.support();

return R1ToR1Integrator.Boole (
new R1ToR1 (null) {
@Override public double evaluate (
double terminalInstance)
throws Exception
{
return _privateValuationUtilityFunction.evaluate (terminalInstance) *
terminalDistribution.density (terminalInstance);
}
},
terminalSupportArray[0],
terminalSupportArray[1]
);
}
private R1ToR1 _privateValuationObjectiveFunction = null;

/**
* Retrieve the Private Valuation Utility Function
*
* @return The Private Valuation Utility Function
*/

public R1ToR1 privateValuationUtilityFunction()
{
return _privateValuationUtilityFunction;
}

/**
* Retrieve the Endowment Value
*
* @return The Endowment Value
*/

public double endowmentValue()
public R1ToR1 privateValuationObjectiveFunction()
{
return _endowmentValue;
return _privateValuationObjectiveFunction;
}

/**
Expand All @@ -204,102 +142,38 @@ public BidAskClaimsHandler bidAskClaimsHandler()
return _bidAskClaimsHandler;
}

/**
* Evaluate the Expected Terminal Endowment Utility Price
*
* @param terminalEndowmentDistribution The Terminal Endowment Distribution
*
* @return The Expected Terminal Endowment Utility Price
*
* @throws Exception The Expected Terminal Endowment Utility Price cannot be estimated
*/

public double expectedTerminalEndowmentUtilityPrice (
final R1Distribution terminalEndowmentDistribution)
public double baselineIndifferenceFunction (
final R1ToR1 risklessUnitsFunction,
final R1Univariate terminalUnderlierDistribution,
final double terminalRisklessPrice,
final double underlierUnits)
throws Exception
{
return expectedTerminalUtilityPrice (terminalEndowmentDistribution);
}

/**
* Evaluate the Expected Terminal Endowment Utility Price
*
* @param terminalEndowmentDistribution The Terminal Endowment Distribution
*
* @return The Expected Terminal Endowment Utility Price
*
* @throws Exception The Expected Terminal Endowment Utility Price cannot be estimated
*/

public double expectedTerminalEndowmentUtilityPrice (
final R1Univariate terminalEndowmentDistribution)
throws Exception
{
return expectedTerminalUtilityPrice (terminalEndowmentDistribution);
}

/**
* Evaluate the Expected Terminal Claims Utility Price
*
* @param terminalClaimsDistribution The Terminal Claims Distribution
*
* @return The Expected Terminal Claims Utility Price
*
* @throws Exception The Expected Terminal Claims Utility Price cannot be estimated
*/

public double expectedTerminalClaimsUtilityPrice (
final R1Distribution terminalClaimsDistribution)
throws Exception
{
return expectedTerminalUtilityPrice (terminalClaimsDistribution);
}

/**
* Evaluate the Expected Terminal Claims Utility Price
*
* @param terminalClaimsDistribution The Terminal Claims Distribution
*
* @return The Expected Terminal Claims Utility Price
*
* @throws Exception The Expected Terminal Claims Utility Price cannot be estimated
*/

public double expectedTerminalClaimsUtilityPrice (
final R1Univariate terminalClaimsDistribution)
throws Exception
{
return expectedTerminalUtilityPrice (terminalClaimsDistribution);
}

/**
* Generate the Function to calculate the Riskless Security Units from the Endowment Value
*
* @param risklessPrice Riskless Security Unit Price
* @param underlierPrice Underlier Security Unit Price
*
* @return Riskless Units Constraint Function
*/
if (null == risklessUnitsFunction ||
null == terminalUnderlierDistribution ||
!NumberUtil.IsValid (terminalRisklessPrice) ||
!NumberUtil.IsValid (underlierUnits)) {
throw new Exception (
"ReservationPricer::baselineIndifferenceFunction => Invalid Terminal Distribution"
);
}

public R1ToR1 risklessUnitsConstraintFunction (
final double risklessPrice,
final double underlierPrice)
{
return !NumberUtil.IsValid (risklessPrice) || !NumberUtil.IsValid (underlierPrice) ?
null : new R1ToR1 (null)
{
@Override public double evaluate (
double underlierUnits)
throws Exception
{
return (_endowmentValue - underlierPrice * underlierUnits) / risklessPrice;
}
};
}
double[] terminalUnderlierSupportArray = terminalUnderlierDistribution.support();

public UtilityOptimizationRun baselineIndifferenceRun (
final R1ToR1 risklessUnitsConstraintFunction)
{
return null;
return R1ToR1Integrator.Boole (
new R1ToR1 (null) {
@Override public double evaluate (
double terminalUnderlierPrice)
throws Exception
{
return _privateValuationObjectiveFunction.evaluate (
terminalRisklessPrice * risklessUnitsFunction.evaluate (underlierUnits) +
terminalUnderlierPrice * underlierUnits
) * terminalUnderlierDistribution.density (terminalUnderlierPrice);
}
},
terminalUnderlierSupportArray[0],
terminalUnderlierSupportArray[1]
);
}
}
Loading

0 comments on commit 1de1193

Please sign in to comment.