Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Measure Discrete R1 Distribution Probability (1, 2, 3)
	- Measure Discrete R1 Distribution Standard (4, 5, 6)
	- Indifference Reservation Pricer Claims Function (7, 8)
	- Reservation Pricer Expected Endowment Utility #1 (9, 10, 11)
	- Reservation Pricer Expected Endowment Utility #2 (12, 13, 14)
	- Reservation Pricer Expected Endowment Utility #3 (15, 16)
	- Reservation Pricer Expected Endowment Utility #4 (17, 18, 19)
	- Reservation Pricer Expected Terminal Utility #1 (20, 21, 22)
	- Reservation Pricer Expected Terminal Utility #2 (23, 24)
	- Expected Terminal Claims Utility Price #1 (25, 26)
	- Expected Terminal Claims Utility Price #2 (27, 28)
	- OMS Indifference Claims Inventory Portfolio (29, 30)
	- Endowment Portfolio Riskless Security Units (32, 33)
	- Endowment Portfolio Claims Security Units (34, 35)
	- OMS Indifference Endowment Portfolio Constructor (36, 37, 38)
	- OMS Indifference Endowment Portfolio Value (39, 40, 41)
	- Reservation Indifference Price Endowment Value (42)
	- Utility Function Optimization Run Shell (43, 44)
	- Utility Optimization Run Endowment Portfolio (45, 46)
	- Utility Optimization Run Optimal Value (47, 48)
	- Utility Optimization Run Endowment Constructor (49, 50, 51)
	- Bid Ask Claims Handler Shell (52, 53)
	- Bid Ask Claims Handler Payoff (54, 55)
	- Endowment Portfolio Underlier Units/Price (56, 57)
	- Bid Ask Claims Handler Units (58, 59)


Bug Fixes/Re-organization:

	- Endowment Portfolio Claims Indifference Pricing (31)
	- Reservation Pricer Claims Payoff Delete (60)

Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Jan 16, 2024
1 parent b3f9f51 commit 280405b
Show file tree
Hide file tree
Showing 7 changed files with 720 additions and 12 deletions.
38 changes: 38 additions & 0 deletions ReleaseNotes/05_17_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

Features:

- Measure Discrete R1 Distribution Probability (1, 2, 3)
- Measure Discrete R1 Distribution Standard (4, 5, 6)
- Indifference Reservation Pricer Claims Function (7, 8)
- Reservation Pricer Expected Endowment Utility #1 (9, 10, 11)
- Reservation Pricer Expected Endowment Utility #2 (12, 13, 14)
- Reservation Pricer Expected Endowment Utility #3 (15, 16)
- Reservation Pricer Expected Endowment Utility #4 (17, 18, 19)
- Reservation Pricer Expected Terminal Utility #1 (20, 21, 22)
- Reservation Pricer Expected Terminal Utility #2 (23, 24)
- Expected Terminal Claims Utility Price #1 (25, 26)
- Expected Terminal Claims Utility Price #2 (27, 28)
- OMS Indifference Claims Inventory Portfolio (29, 30)
- Endowment Portfolio Riskless Security Units (32, 33)
- Endowment Portfolio Claims Security Units (34, 35)
- OMS Indifference Endowment Portfolio Constructor (36, 37, 38)
- OMS Indifference Endowment Portfolio Value (39, 40, 41)
- Reservation Indifference Price Endowment Value (42)
- Utility Function Optimization Run Shell (43, 44)
- Utility Optimization Run Endowment Portfolio (45, 46)
- Utility Optimization Run Optimal Value (47, 48)
- Utility Optimization Run Endowment Constructor (49, 50, 51)
- Bid Ask Claims Handler Shell (52, 53)
- Bid Ask Claims Handler Payoff (54, 55)
- Endowment Portfolio Underlier Units/Price (56, 57)
- Bid Ask Claims Handler Units (58, 59)


Bug Fixes/Re-organization:

- Endowment Portfolio Claims Indifference Pricing (31)
- Reservation Pricer Claims Payoff Delete (60)

Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
75 changes: 68 additions & 7 deletions src/main/java/org/drip/measure/discrete/R1Distribution.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,77 @@

public class R1Distribution
{
private TreeMap<Double, Double> _probabilityMap = new TreeMap<Double, Double>();
private TreeMap<Double, Double> _probabilityMap = null;

private R1Distribution (
final TreeMap<Double, Double> probabilityMap)
throws Exception
/**
* Generate an Standard Instance of Discrete <i>R1Distribution</i>
*
* @param instanceArray Instance Array
* @param probabilityArray Probability Array
*
* @return Standard Instance of Discrete <i>R1Distribution</i>
*/

public static R1Distribution Standard (
final double[] instanceArray,
final double[] probabilityArray)
{
if (null == (_probabilityMap = probabilityMap) || 0 == _probabilityMap.size())
if (null == instanceArray ||
null == probabilityArray)
{
return null;
}

int instanceCount = instanceArray.length;

if (0 == instanceCount || instanceCount != probabilityArray.length)
{
return null;
}

TreeMap<Double, Double> probabilityMap = new TreeMap<Double, Double>();

double cumulativeProbability = 0.;

for (double probability : probabilityArray)
{
throw new Exception ("R1Distribution Constructor => Invalid Inputs");
if (!NumberUtil.IsValid (probability) || 0. > probability)
{
return null;
}

cumulativeProbability += probability;
}

if (0. == cumulativeProbability)
{
return null;
}

for (int i = 0; i < instanceCount; ++i)
{
if (!NumberUtil.IsValid (instanceArray[i]))
{
return null;
}

probabilityMap.put (instanceArray[i], probabilityArray[i] / cumulativeProbability);
}

try
{
return new R1Distribution (probabilityMap);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

private R1Distribution (
final TreeMap<Double, Double> probabilityMap)
{
_probabilityMap = probabilityMap;
}

/**
Expand Down Expand Up @@ -139,7 +200,7 @@ public double probability (
{
if (!NumberUtil.IsValid (x) || !_probabilityMap.containsKey (x))
{
throw new Exception ("R1Distribution::probability =>_probabilityMap");
throw new Exception ("R1Distribution::probability => Input Instance is Invalid");
}

return _probabilityMap.get (x);
Expand Down
141 changes: 141 additions & 0 deletions src/main/java/org/drip/oms/indifference/BidAskClaimsHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@

package org.drip.oms.indifference;

import org.drip.function.definition.R1ToR1;

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

/*!
* Copyright (C) 2024 Lakshmi Krishnamurthy
*
* This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
* asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
* analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
* equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
* numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
* graph builder/navigator, and computational support.
*
* https://lakshmidrip.github.io/DROP/
*
* DROP is composed of three modules:
*
* - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
* - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
* - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
*
* DROP Product Core implements libraries for the following:
* - Fixed Income Analytics
* - Loan Analytics
* - Transaction Cost Analytics
*
* DROP Portfolio Core implements libraries for the following:
* - Asset Allocation Analytics
* - Asset Liability Management Analytics
* - Capital Estimation Analytics
* - Exposure Analytics
* - Margin Analytics
* - XVA Analytics
*
* DROP Computational Core implements libraries for the following:
* - Algorithm Support
* - Computation Support
* - Function Analysis
* - Graph Algorithm
* - Model Validation
* - Numerical Analysis
* - Numerical Optimizer
* - Spline Builder
* - Statistical Learning
*
* Documentation for DROP is Spread Over:
*
* - Main => https://lakshmidrip.github.io/DROP/
* - Wiki => https://github.com/lakshmiDRIP/DROP/wiki
* - GitHub => https://github.com/lakshmiDRIP/DROP
* - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
* - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html
* - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
* - Release Versions => https://lakshmidrip.github.io/DROP/version.html
* - Community Credits => https://lakshmidrip.github.io/DROP/credits.html
* - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* <i>BidAskClaimsHandler</i> works the Bid/Ask Sided Claims Price using the Indifference Pricing Scheme. The
* References are:
*
* <br><br>
* <ul>
* <li>
* Birge, J. R. (2008): <i>Financial Engineering</i> <b>Elsevier</b> Amsterdam Netherlands
* </li>
* <li>
* Carmona, R. (2009): <i>Indifference Pricing: Theory and Applications</i> <b>Princeton
* University Press</b> Princeton NJ
* </li>
* <li>
* Vassilis, P. (2005): Slow and Fast Markets <i>Journal of Economics and Business</i> <b>57
* (6)</b> 576-593
* </li>
* <li>
* Weiss, D. (2006): <i>After the Trade is Made: Processing Securities Transactions</i> <b>Portfolio
* Publishing</b> London UK
* </li>
* <li>
* Wikipedia (2021): Indifference Price https://en.wikipedia.org/wiki/Indifference_price
* </li>
* </ul>
*
* <br><br>
* <ul>
* <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
* <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/TransactionCostAnalyticsLibrary.md">Transaction Cost Analytics</a></li>
* <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/oms/README.md">R<sup>d</sup> Order Specification, Handling, and Management</a></li>
* <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/oms/indifference/README.md">Reservation Price Good-deal Bounds</a></li>
* </ul>
*
* @author Lakshmi Krishnamurthy
*/

public class BidAskClaimsHandler
{
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;
}
}
Loading

0 comments on commit 280405b

Please sign in to comment.