Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Utility Function Private Valuation Ojective (46)
	- Agent Optimization Utility Function Expectation (47, 48)
	- Utility Expectation Function Inventory Vertex (49, 50, 51)
	- Utility Expectation Function Money Market (52, 53)
	- Utility Expectation Function Evaluate #1 (54, 55, 56)
	- Utility Expectation Function Evaluate #2 (57, 58)
	- Utility Expectation Function Evaluate #3 (59, 60)


Bug Fixes/Re-organization:

	- Special Function Definition Riccati Bessel Zita Estimator (1)
	- Special Function Definition Riccati Bessel Zita Estimator - Evaluate (2)
	- Special Function Definition Scaled Exponential Estimator (3, 4, 5)
	- Special Function Definition Scaled Exponential Estimator - Exponent (6, 7)
	- Special Function Definition Scaled Exponential Estimator - Characteristic Relaxation Time (8, 9)
	- Special Function Definition Scaled Exponential Estimator - Constructor (10, 11)
	- Special Function Definition Scaled Exponential Estimator - Evaluate (12, 13)
	- Special Function Definition Scaled Exponential Estimator - Evaluate Using Density (14, 15, 16)
	- Special Function Definition Scaled Exponential Estimator - Is Compressed (17)
	- Special Function Definition Scaled Exponential Estimator - Is Stretched (18)
	- Special Function Definition Scaled Exponential Estimator - Is Unscaled (19)
	- Special Function Definition Scaled Exponential Estimator - Is Normal (20)
	- Special Function Definition Scaled Exponential Estimator - First Moment (21, 22)
	- Special Function Definition Scaled Exponential Estimator - Higher Moment (23, 24)
	- Special Function Definition Scaled Exponential Estimator - Higher Moments Using Density #1 (25, 26)
	- Special Function Definition Scaled Exponential Estimator - Higher Moments Using Density #2 (27, 28)
	- Special Function Definition Scaled Exponential Estimator - Log Relaxation First Moment (29)
	- Special Function Definition Spherical Bessel First Kind Estimator (30, 31)
	- Special Function Definition Spherical Bessel First Kind Estimator - Small J (32)
	- Special Function Definition Spherical Bessel First Kind Estimator - Evaluate (33)
	- Special Function Definition Spherical Bessel Second Kind Estimator (34, 35)
	- Special Function Definition Spherical Bessel Second Kind Estimator - Small Y (36)
	- Special Function Definition Spherical Bessel First Kind Estimator - Evaluate (37)
	- Special Function Definition Spherical Hankel First Kind Estimator (38, 39)
	- Special Function Definition Spherical Hankel First Kind Estimator - Small H1 (40)
	- Special Function Definition Spherical Hankel First Kind Estimator - Evaluate (41)
	- Special Function Definition Spherical Bessel Second Kind Estimator - Evaluate (42, 43)
	- Special Function Definition Spherical Hankel Second Kind Estimator - Small H2 (44)
	- Special Function Definition Spherical Hankel Second Kind Estimator - Evaluate (45)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Feb 4, 2024
1 parent 4b3c852 commit ff32c58
Show file tree
Hide file tree
Showing 9 changed files with 372 additions and 152 deletions.
48 changes: 48 additions & 0 deletions ReleaseNotes/06_12_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

Features:

- Utility Function Private Valuation Ojective (46)
- Agent Optimization Utility Function Expectation (47, 48)
- Utility Expectation Function Inventory Vertex (49, 50, 51)
- Utility Expectation Function Money Market (52, 53)
- Utility Expectation Function Evaluate #1 (54, 55, 56)
- Utility Expectation Function Evaluate #2 (57, 58)
- Utility Expectation Function Evaluate #3 (59, 60)


Bug Fixes/Re-organization:

- Special Function Definition Riccati Bessel Zita Estimator (1)
- Special Function Definition Riccati Bessel Zita Estimator - Evaluate (2)
- Special Function Definition Scaled Exponential Estimator (3, 4, 5)
- Special Function Definition Scaled Exponential Estimator - Exponent (6, 7)
- Special Function Definition Scaled Exponential Estimator - Characteristic Relaxation Time (8, 9)
- Special Function Definition Scaled Exponential Estimator - Constructor (10, 11)
- Special Function Definition Scaled Exponential Estimator - Evaluate (12, 13)
- Special Function Definition Scaled Exponential Estimator - Evaluate Using Density (14, 15, 16)
- Special Function Definition Scaled Exponential Estimator - Is Compressed (17)
- Special Function Definition Scaled Exponential Estimator - Is Stretched (18)
- Special Function Definition Scaled Exponential Estimator - Is Unscaled (19)
- Special Function Definition Scaled Exponential Estimator - Is Normal (20)
- Special Function Definition Scaled Exponential Estimator - First Moment (21, 22)
- Special Function Definition Scaled Exponential Estimator - Higher Moment (23, 24)
- Special Function Definition Scaled Exponential Estimator - Higher Moments Using Density #1 (25, 26)
- Special Function Definition Scaled Exponential Estimator - Higher Moments Using Density #2 (27, 28)
- Special Function Definition Scaled Exponential Estimator - Log Relaxation First Moment (29)
- Special Function Definition Spherical Bessel First Kind Estimator (30, 31)
- Special Function Definition Spherical Bessel First Kind Estimator - Small J (32)
- Special Function Definition Spherical Bessel First Kind Estimator - Evaluate (33)
- Special Function Definition Spherical Bessel Second Kind Estimator (34, 35)
- Special Function Definition Spherical Bessel Second Kind Estimator - Small Y (36)
- Special Function Definition Spherical Bessel First Kind Estimator - Evaluate (37)
- Special Function Definition Spherical Hankel First Kind Estimator (38, 39)
- Special Function Definition Spherical Hankel First Kind Estimator - Small H1 (40)
- Special Function Definition Spherical Hankel First Kind Estimator - Evaluate (41)
- Special Function Definition Spherical Bessel Second Kind Estimator - Evaluate (42, 43)
- Special Function Definition Spherical Hankel Second Kind Estimator - Small H2 (44)
- Special Function Definition Spherical Hankel Second Kind Estimator - Evaluate (45)


Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
18 changes: 9 additions & 9 deletions src/main/java/org/drip/oms/indifference/UtilityFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,34 @@

public class UtilityFunction
{
private R1ToR1 _agentObjective = null;
private R1ToR1 _privateValuationObjective = null;

/**
* UtilityFunction Constructor
*
* @param agentObjective Agent Objective Function
* @param privateValuationObjective Agent Objective Function
*
* @throws Exception Thrown if the Inputs are Invalid
*/

public UtilityFunction (
final R1ToR1 agentObjective)
final R1ToR1 privateValuationObjective)
throws Exception
{
if (null == (_agentObjective = agentObjective)) {
if (null == (_privateValuationObjective = privateValuationObjective)) {
throw new Exception ("UtilityFunction Constructor => Invalid Inputs");
}
}

/**
* Retrieve the Agent's Objective Function
* Retrieve the Agent's Private Valuation Function
*
* @return The Agent's Objective Function
* @return The Agent's Private Valuation Function
*/

public R1ToR1 agentObjective()
public R1ToR1 privateValuationObjective()
{
return _agentObjective;
return _privateValuationObjective;
}

/**
Expand All @@ -162,6 +162,6 @@ public double evaluate (
throw new Exception ("UtilityFunction::evaluate => Invald Position Vertex");
}

return _agentObjective.evaluate (positionVertex.value());
return _privateValuationObjective.evaluate (positionVertex.value());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

package org.drip.oms.indifference;

import org.drip.measure.continuous.R1Univariate;
import org.drip.measure.discrete.R1Distribution;

/*
* -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*/
Expand Down Expand Up @@ -112,5 +115,114 @@

public class UtilityFunctionExpectation
{
private UtilityFunction _utilityFunction = null;
private double _moneyMarketPrice = Double.NaN;
private UtilityFunction _agentOptimizer = null;
private InventoryVertex _inventoryVertex = null;

/**
* Retrieve the Agent Optimization Utility Function
*
* @return Agent Optimization Utility Function
*/

public UtilityFunction agentOptimizer()
{
return _agentOptimizer;
}

/**
* Retrieve the Inventory Vertex
*
* @return The Inventory Vertex
*/

public InventoryVertex inventoryVertex()
{
return _inventoryVertex;
}

/**
* Retrieve the Price of Money Market Entity
*
* @return Number of Money Market Entity
*/

public double moneyMarketPrice()
{
return _moneyMarketPrice;
}

/**
* Compute the Agent's Objective Function Value For the Underlier Price
*
* @param underlierPrice The Underlier Price
*
* @return The Agent's Objective Function Value For the Underlier Price
*
* @throws Exception Thrown if the Agent's Objective Function Value cannot be calculated
*/

public double objectiveValue (
final double underlierPrice)
throws Exception
{
return _agentOptimizer.evaluate (
new PositionVertex (
_inventoryVertex,
new RealizationVertex (_moneyMarketPrice, underlierPrice),
_agentOptimizer.privateValuationObjective()
)
);
}

/**
* Compute the Expectation of the Agent Utility Function given the Underlier Price Array and Discrete
* Distribution
*
* @param underlierPriceDistribution Discrete Underlier Price Distribution
* @param underlierPriceArray Underlier Price Array
*
* @return Expectation of the Agent Utility Function
*
* @throws Exception Thrown if the Inputs are Invalid
*/

public double evaluate (
final R1Distribution underlierPriceDistribution,
final double[] underlierPriceArray)
throws Exception
{
if (null == underlierPriceDistribution ||
null == underlierPriceArray || 0 == underlierPriceArray.length) {
throw new Exception ("UtilityFunctionExpectation::evaluate => Invalid Inputs");
}

double utilityFunctionExpectationValue = 0.;

for (double underlierPrice : underlierPriceArray) {
utilityFunctionExpectationValue += underlierPriceDistribution.probability (underlierPrice) *
_agentOptimizer.evaluate (
new PositionVertex (
_inventoryVertex,
new RealizationVertex (_moneyMarketPrice, underlierPrice),
_agentOptimizer.privateValuationObjective()
)
);
}

return utilityFunctionExpectationValue;
}

public double evaluate (
final R1Univariate underlierPriceDistribution)
throws Exception
{
if (null == underlierPriceDistribution) {
throw new Exception ("UtilityFunctionExpectation::evaluate => Invalid Inputs");
}

double utilityFunctionExpectationValue = 0.;

return utilityFunctionExpectationValue;
}
}
Loading

0 comments on commit ff32c58

Please sign in to comment.