diff --git a/ReleaseNotes/05_25_2023.txt b/ReleaseNotes/05_25_2023.txt
new file mode 100644
index 00000000000..1692393ab09
--- /dev/null
+++ b/ReleaseNotes/05_25_2023.txt
@@ -0,0 +1,37 @@
+
+Features:
+
+ - Reservation Pricer Baseline Indifference Value #1 (1, 2)
+ - Reservation Pricer Baseline Indifference Value #2 (3, 4)
+ - Reservation Pricer Baseline Indifference Value #3 (5, 6)
+ - Indifference Reservation Pricer Process Shell (7, 8, 9)
+ - Indifference Reservation Pricer Pay-off Price (11, 12)
+ - Claims Adjusted Utility Value #1 (13, 14, 15)
+ - Claims Adjusted Utility Value #2 (16, 17, 18)
+ - Claims Adjusted Reservation Utility Function (19, 20, 21)
+ - Optimal Claims Adjusted Underlier Units (22, 23)
+ - Baseline Flow Claims Unit Array (24)
+ - Reservation Pricer Indifference Price Shell (25, 26)
+ - Claims Adjusted Unit Price Array #1 (27, 28)
+ - Claims Adjusted Unit Price Array #2 (29, 30)
+ - Reservation Pricer Utility Value #1 (31, 32, 33)
+ - Claims Adjusted Endowment Portfolio Solver (34, 35, 36)
+ - Reservation Pricer Utility Value #2 (37, 38)
+ - Optimal Claims Price Adjusted Function (39, 40, 41)
+ - Optimal Claims Adjusted Endowment Portfolio #1 (42, 43, 44)
+ - Optimal Claims Adjusted Endowment Portfolio #2 (45, 46, 47)
+ - Optimal Claims Adjusted Endowment Portfolio #3 (48, 49, 50)
+ - Claims Adjusted Unit Price Array #2 (51, 52)
+ - Underlier Utility Optimization Run #1 (53, 54, 55)
+ - Underlier Utility Optimization Run #2 (56, 57, 58)
+ - OMS Indifference Reservation Price Run (59, 60)
+
+
+Bug Fixes/Re-organization:
+
+ - Bid Ask Claims Handler Delete (10)
+
+
+Samples:
+
+IdeaDRIP:
diff --git a/ScheduleSheet.xlsx b/ScheduleSheet.xlsx
index beebd1d3a83..be6afae66bf 100644
Binary files a/ScheduleSheet.xlsx and b/ScheduleSheet.xlsx differ
diff --git a/src/main/java/org/drip/oms/indifference/BidAskClaimsHandler.java b/src/main/java/org/drip/oms/indifference/ReservationPriceRun.java
similarity index 89%
rename from src/main/java/org/drip/oms/indifference/BidAskClaimsHandler.java
rename to src/main/java/org/drip/oms/indifference/ReservationPriceRun.java
index 9704787d63b..175f268f4e1 100644
--- a/src/main/java/org/drip/oms/indifference/BidAskClaimsHandler.java
+++ b/src/main/java/org/drip/oms/indifference/ReservationPriceRun.java
@@ -1,8 +1,6 @@
package org.drip.oms.indifference;
-import org.drip.function.definition.R1ToR1;
-
/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
@@ -76,8 +74,8 @@
*/
/**
- * BidAskClaimsHandler works the Bid/Ask Sided Claims Price using the Indifference Pricing Scheme. The
- * References are:
+ * ReservationPriceRun captures the Results of a Claims Adjusted Indifference Pricing Run.
+ * The References are:
*
*
*
@@ -112,30 +110,7 @@
* @author Lakshmi Krishnamurthy
*/
-public class BidAskClaimsHandler
+public class ReservationPriceRun
{
- private double _units = Double.NaN;
- private R1ToR1 _payoffFunction = null;
-
- /**
- * Retrieve the Claims Payoff Function
- *
- * @return The Claims Payoff Function
- */
-
- public R1ToR1 payoffFunction()
- {
- return _payoffFunction;
- }
-
- /**
- * Retrieve the Sided Units
- *
- * @return The Sided Units
- */
- public double units()
- {
- return _units;
- }
}
diff --git a/src/main/java/org/drip/oms/indifference/ReservationPricer.java b/src/main/java/org/drip/oms/indifference/ReservationPricer.java
index 60f3c43cb66..80a20b64686 100644
--- a/src/main/java/org/drip/oms/indifference/ReservationPricer.java
+++ b/src/main/java/org/drip/oms/indifference/ReservationPricer.java
@@ -2,6 +2,8 @@
package org.drip.oms.indifference;
import org.drip.function.definition.R1ToR1;
+import org.drip.function.r1tor1solver.FixedPointFinderOutput;
+import org.drip.function.r1tor1solver.FixedPointFinderZheng;
import org.drip.measure.continuous.R1Univariate;
import org.drip.numerical.common.NumberUtil;
import org.drip.numerical.integration.R1ToR1Integrator;
@@ -117,7 +119,7 @@
public class ReservationPricer
{
- private BidAskClaimsHandler _bidAskClaimsHandler = null;
+ private R1ToR1 _payoffFunction = null;
private R1ToR1 _privateValuationObjectiveFunction = null;
/**
@@ -132,17 +134,74 @@ public R1ToR1 privateValuationObjectiveFunction()
}
/**
- * Retrieve the Bid/Ask Claims Handler
+ * Retrieve the Payoff Function
*
- * @return The Bid/Ask Claims Handler
+ * @return The Payoff Function
*/
- public BidAskClaimsHandler bidAskClaimsHandler()
+ public R1ToR1 payoffFunction()
{
- return _bidAskClaimsHandler;
+ return _payoffFunction;
}
- public double baselineIndifferenceFunction (
+ public double claimsAdjustedPrice (
+ final R1ToR1 claimsAdjustedUnderlierUnitFunction,
+ final double indifferencePrice)
+ throws Exception
+ {
+ if (null == claimsAdjustedUnderlierUnitFunction) {
+ throw new Exception ("ReservationPricer::claimsAdjustedPrice => Cannot find Root");
+ }
+
+ FixedPointFinderOutput fixedPointFinderOutput = new FixedPointFinderZheng (
+ indifferencePrice,
+ new R1ToR1 (null) {
+ @Override public final double evaluate (
+ final double claimsAdjustedPrice)
+ throws Exception
+ {
+ return claimsAdjustedUnderlierUnitFunction.evaluate (claimsAdjustedPrice);
+ }
+ },
+ false
+ ).findRoot();
+
+ if (null == fixedPointFinderOutput) {
+ throw new Exception ("ReservationPricer::claimsAdjustedEndowmentPortfolio => Cannot find Root");
+ }
+
+ return fixedPointFinderOutput.getRoot();
+ }
+
+ public double baselineUtilityValue (
+ final R1ToR1 risklessUnitsFunction,
+ final double terminalRisklessPrice,
+ final double terminalUnderlierPrice,
+ final double underlierUnits)
+ throws Exception
+ {
+ return _privateValuationObjectiveFunction.evaluate (
+ terminalRisklessPrice * risklessUnitsFunction.evaluate (underlierUnits) +
+ terminalUnderlierPrice * underlierUnits
+ );
+ }
+
+ public double claimsAdjustedUtilityValue (
+ final R1ToR1 risklessUnitsFunction,
+ final double terminalRisklessPrice,
+ final double terminalUnderlierPrice,
+ final double underlierUnits,
+ final double claimUnits)
+ throws Exception
+ {
+ return _privateValuationObjectiveFunction.evaluate (
+ terminalRisklessPrice * risklessUnitsFunction.evaluate (underlierUnits) +
+ terminalUnderlierPrice * underlierUnits +
+ claimUnits * _payoffFunction.evaluate (terminalUnderlierPrice)
+ );
+ }
+
+ public double baselineUtilityFunction (
final R1ToR1 risklessUnitsFunction,
final R1Univariate terminalUnderlierDistribution,
final double terminalRisklessPrice,
@@ -154,7 +213,46 @@ public double baselineIndifferenceFunction (
!NumberUtil.IsValid (terminalRisklessPrice) ||
!NumberUtil.IsValid (underlierUnits)) {
throw new Exception (
- "ReservationPricer::baselineIndifferenceFunction => Invalid Terminal Distribution"
+ "ReservationPricer::baselineUtilityFunction => Invalid Terminal Distribution"
+ );
+ }
+
+ double[] terminalUnderlierSupportArray = terminalUnderlierDistribution.support();
+
+ return R1ToR1Integrator.Boole (
+ new R1ToR1 (null) {
+ @Override public double evaluate (
+ double terminalUnderlierPrice)
+ throws Exception
+ {
+ return baselineUtilityValue (
+ risklessUnitsFunction,
+ terminalRisklessPrice,
+ terminalUnderlierPrice,
+ underlierUnits
+ ) * terminalUnderlierDistribution.density (terminalUnderlierPrice);
+ }
+ },
+ terminalUnderlierSupportArray[0],
+ terminalUnderlierSupportArray[1]
+ );
+ }
+
+ public double claimsAdjustedUtilityFunction (
+ final R1ToR1 risklessUnitsFunction,
+ final R1Univariate terminalUnderlierDistribution,
+ final double terminalRisklessPrice,
+ final double underlierUnits,
+ final double claimsUnits)
+ throws Exception
+ {
+ if (null == risklessUnitsFunction ||
+ null == terminalUnderlierDistribution ||
+ !NumberUtil.IsValid (terminalRisklessPrice) ||
+ !NumberUtil.IsValid (underlierUnits) ||
+ !NumberUtil.IsValid (claimsUnits)) {
+ throw new Exception (
+ "ReservationPricer::claimsAdjustedUtilityFunction => Invalid Terminal Distribution"
);
}
@@ -166,9 +264,12 @@ public double baselineIndifferenceFunction (
double terminalUnderlierPrice)
throws Exception
{
- return _privateValuationObjectiveFunction.evaluate (
- terminalRisklessPrice * risklessUnitsFunction.evaluate (underlierUnits) +
- terminalUnderlierPrice * underlierUnits
+ return claimsAdjustedUtilityValue (
+ risklessUnitsFunction,
+ terminalRisklessPrice,
+ terminalUnderlierPrice,
+ underlierUnits,
+ claimsUnits
) * terminalUnderlierDistribution.density (terminalUnderlierPrice);
}
},
diff --git a/src/main/java/org/drip/oms/indifference/ReservationPricerProcessShell.java b/src/main/java/org/drip/oms/indifference/ReservationPricerProcessShell.java
index be0051c8600..a48a8e9a0cb 100644
--- a/src/main/java/org/drip/oms/indifference/ReservationPricerProcessShell.java
+++ b/src/main/java/org/drip/oms/indifference/ReservationPricerProcessShell.java
@@ -125,6 +125,13 @@ protected abstract double optimalBaselineUnderlierUnits (
final double terminalRisklessPrice)
throws Exception;
+ protected abstract R1ToR1 claimsAdjustedUnderlierUnitFunction (
+ final R1ToR1 risklessUnitsFunction,
+ final R1Univariate terminalUnderlierDistribution,
+ final double terminalRisklessPrice,
+ final double claimsUnits
+ );
+
/**
* Retrieve the Endowment Value
*
@@ -174,19 +181,61 @@ public R1ToR1 risklessUnitsFunction (
public UtilityOptimizationRun baselineFlow (
final double terminalRisklessPrice,
+ final double terminalUnderlierPrice,
final R1ToR1 risklessUnitsFunction,
- final R1Univariate terminalUnderlierDistribution)
+ final R1Univariate terminalUnderlierDistribution,
+ final double[] claimsUnitArray)
{
- double optimalBaselineUnderlierUnits = Double.NaN;
+ if (null == claimsUnitArray || !NumberUtil.IsValid (claimsUnitArray)) {
+ return null;
+ }
+
+ int claimsUnitCount = claimsUnitArray.length;
+ double[] claimsUnitAdjustedPriceArray = new double[claimsUnitCount];
+
+ if (0 == claimsUnitCount) {
+ return null;
+ }
try {
- if (!NumberUtil.IsValid (
- optimalBaselineUnderlierUnits = optimalBaselineUnderlierUnits (
+ double optimalBaselineUnderlierUnits = optimalBaselineUnderlierUnits (
+ risklessUnitsFunction,
+ terminalUnderlierDistribution,
+ terminalRisklessPrice
+ );
+
+ if (!NumberUtil.IsValid (optimalBaselineUnderlierUnits)) {
+ return null;
+ }
+
+ double indifferencePrice = _reservationPricer.baselineUtilityValue (
+ risklessUnitsFunction,
+ terminalRisklessPrice,
+ terminalUnderlierPrice,
+ optimalBaselineUnderlierUnits
+ );
+
+ if (!NumberUtil.IsValid (indifferencePrice)) {
+ return null;
+ }
+
+ for (int claimsUnitIndex = 0; claimsUnitIndex < claimsUnitCount; ++claimsUnitIndex) {
+ R1ToR1 claimsAdjustedUnderlierUnitFunction = claimsAdjustedUnderlierUnitFunction (
risklessUnitsFunction,
terminalUnderlierDistribution,
- terminalRisklessPrice
- )
- ));
+ terminalRisklessPrice,
+ claimsUnitArray[claimsUnitIndex]
+ );
+
+ if (null == claimsAdjustedUnderlierUnitFunction) {
+ return null;
+ }
+
+ claimsUnitAdjustedPriceArray[claimsUnitIndex] = _reservationPricer.claimsAdjustedPrice (
+ claimsAdjustedUnderlierUnitFunction,
+ indifferencePrice
+ );
+ }
} catch (Exception e) {
e.printStackTrace();
diff --git a/src/main/java/org/drip/oms/indifference/UtilityOptimizationRun.java b/src/main/java/org/drip/oms/indifference/UtilityOptimizationRun.java
index 8928f1992dc..e55d93120ac 100644
--- a/src/main/java/org/drip/oms/indifference/UtilityOptimizationRun.java
+++ b/src/main/java/org/drip/oms/indifference/UtilityOptimizationRun.java
@@ -114,49 +114,49 @@
public class UtilityOptimizationRun
{
- private double _reservationValue = Double.NaN;
- private EndowmentPortfolio _endowmentPortfolio = null;
+ private double _underlierUnits = Double.NaN;
+ private double _optimalExpectationValue = Double.NaN;
/**
* UtilityOptimizationRun Constructor
*
- * @param endowmentPortfolio Optimal Endowment Portfolio
- * @param reservationValue Optimal Utility Indifference/Reservation Value
+ * @param optimalExpectationValue Optimal Expectation Value
+ * @param underlierUnits Optimal Underlier Units
*
* @throws Exception Thrown if the Inputs are Invalid
*/
public UtilityOptimizationRun (
- final EndowmentPortfolio endowmentPortfolio,
- final double reservationValue)
+ final double optimalExpectationValue,
+ final double underlierUnits)
throws Exception
{
- if (null == (_endowmentPortfolio = endowmentPortfolio) ||
- !NumberUtil.IsValid (_reservationValue = reservationValue))
+ if (!NumberUtil.IsValid (_optimalExpectationValue = optimalExpectationValue) ||
+ !NumberUtil.IsValid (_underlierUnits = underlierUnits))
{
throw new Exception ("UtilityOptimizationRun Contructor => Invalid Inputs");
}
}
/**
- * Retrieve the Optimal Endowment Portfolio
+ * Retrieve the Optimal Expectation Value
*
- * @return The Optimal Endowment Portfolio
+ * @return The Optimal Expectation Value
*/
- public EndowmentPortfolio endowmentPortfolio()
+ public double optimalExpectationValue()
{
- return _endowmentPortfolio;
+ return _optimalExpectationValue;
}
/**
- * Retrieve the Optimal Utility Indifference/Reservation Value
+ * Retrieve the Optimal Underlier Units
*
- * @return The Optimal Utility Indifference/Reservation Value
+ * @return The Optimal Underlier Units
*/
- public double reservationValue()
+ public double underlierUnits()
{
- return _reservationValue;
+ return _underlierUnits;
}
}