Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
	- Zero Position Value Adjustment Hint (1, 2, 3)
	- Optimal No-Claims Inventory Vertex (4, 5, 6)
	- Optimal Claims Adjusted Inventory Vertex (7, 8, 9)
	- Indifference Claims Position Pricer Shell (10, 11)
	- Claims Position Pricer Payoff Function #1 (12, 13)
	- Indifference Claims Position Pricer Size (14, 15)
	- Indifference Claims Position Pricer - Constructor (16, 17, 18)
	- Unit Bid Claims Position Pricer (19, 20, 21)
	- Unit Ask Claims Position Pricer (22)
	- Position Vertex Claims Sice Pricer (23, 24, 25)
	- Claims Position Pricer Payoff Function #2 (26, 27, 28)
	- Utility Function Expectation Claims Pricer (29, 30, 31)
	- No Claims Inventory Utility Expectation (33)
	- Claims Based Inventory Utility Expectation #1 (34, 35, 36)
	- Claims Based Inventory Utility Expectation #2 (37)
	- R1Distribution Infer Position Value Adjustment (38, 39, 40)
	- Indifference Reservation Claims Position Pricer (41, 42)
	- Bid Claims Position Value Adjustment (43, 44, 45)
	- Ask Claims Position Value Adjustment (46, 47, 48)
	- OMS Indifference Reservation Pricing Run #1 (49, 50, 51)
	- Reservation Pricing Run Bid Private (52, 53)
	- Reservation Pricing Run ask Private (54, 55)
	- Indifference Pricing Reservation Run Constructor (56, 57, 58)
	- OMS Indifference Reservation Pricing Run #2 (59, 60)


Bug Fixes/Re-organization:

	- Inventory Vertex Claims Units Remove (32)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Feb 4, 2024
1 parent b42fdd0 commit 514a5d2
Show file tree
Hide file tree
Showing 8 changed files with 580 additions and 46 deletions.
37 changes: 37 additions & 0 deletions ReleaseNotes/06_14_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Features:

- Zero Position Value Adjustment Hint (1, 2, 3)
- Optimal No-Claims Inventory Vertex (4, 5, 6)
- Optimal Claims Adjusted Inventory Vertex (7, 8, 9)
- Indifference Claims Position Pricer Shell (10, 11)
- Claims Position Pricer Payoff Function #1 (12, 13)
- Indifference Claims Position Pricer Size (14, 15)
- Indifference Claims Position Pricer - Constructor (16, 17, 18)
- Unit Bid Claims Position Pricer (19, 20, 21)
- Unit Ask Claims Position Pricer (22)
- Position Vertex Claims Sice Pricer (23, 24, 25)
- Claims Position Pricer Payoff Function #2 (26, 27, 28)
- Utility Function Expectation Claims Pricer (29, 30, 31)
- No Claims Inventory Utility Expectation (33)
- Claims Based Inventory Utility Expectation #1 (34, 35, 36)
- Claims Based Inventory Utility Expectation #2 (37)
- R1Distribution Infer Position Value Adjustment (38, 39, 40)
- Indifference Reservation Claims Position Pricer (41, 42)
- Bid Claims Position Value Adjustment (43, 44, 45)
- Ask Claims Position Value Adjustment (46, 47, 48)
- OMS Indifference Reservation Pricing Run #1 (49, 50, 51)
- Reservation Pricing Run Bid Private (52, 53)
- Reservation Pricing Run ask Private (54, 55)
- Indifference Pricing Reservation Run Constructor (56, 57, 58)
- OMS Indifference Reservation Pricing Run #2 (59, 60)


Bug Fixes/Re-organization:

- Inventory Vertex Claims Units Remove (32)


Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
201 changes: 201 additions & 0 deletions src/main/java/org/drip/oms/indifference/ClaimsPositionPricer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@

package org.drip.oms.indifference;

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

/*
* -*- 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>ClaimsPositionPricer</i> prices the Claims Position using Payoff on the Underlying Asset. 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 ClaimsPositionPricer
{
private double _size = Double.NaN;
private R1ToR1 _payoffFunction = null;

/**
* Construct a Unit Bid ClaimsPositionPricer Instance
*
* @param payoffFunction Claims Payoff Function
*
* @return Unit Bid ClaimsPositionPricer Instance
*/

public ClaimsPositionPricer UnitBid (
final R1ToR1 payoffFunction)
{
try {
return new ClaimsPositionPricer (payoffFunction, 1.);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

/**
* Construct a Unit Ask ClaimsPositionPricer Instance
*
* @param payoffFunction Claims Payoff Function
*
* @return Unit Ask ClaimsPositionPricer Instance
*/

public ClaimsPositionPricer UnitAsk (
final R1ToR1 payoffFunction)
{
try {
return new ClaimsPositionPricer (payoffFunction, -1.);
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

/**
* ClaimsPositionPricer Constructor
*
* @param payoffFunction Claims Payoff Function
* @param size Claims Size
*
* @throws Exception Thrown if the Inputs are Invalid
*/

public ClaimsPositionPricer (
final R1ToR1 payoffFunction,
final double size)
throws Exception
{
if (null == (_payoffFunction = payoffFunction) || !NumberUtil.IsValid (_size = size)) {
throw new Exception ("ClaimsPositionPricer Constructor => Invalid Inputs");
}
}

/**
* Retrieve the Claims Payoff Function
*
* @return The Claims Payoff Function
*/

public R1ToR1 payoffFunction()
{
return _payoffFunction;
}

/**
* Retrieve the Claims Size
*
* @return The Claims Size
*/

public double size()
{
return _size;
}
}
19 changes: 2 additions & 17 deletions src/main/java/org/drip/oms/indifference/InventoryVertex.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@

public class InventoryVertex
{
private double _claimUnits = Double.NaN;
private double _underlierUnits = Double.NaN;
private double _moneyMarketUnits = Double.NaN;

Expand All @@ -123,20 +122,17 @@ public class InventoryVertex
*
* @param moneyMarketUnits Number of Money Market Units
* @param underlierUnits Number of Underlier Units
* @param claimUnits Number of Claim Units
*
* @throws Exception Thrown if the Inputs are Invalid
*/

public InventoryVertex (
final double moneyMarketUnits,
final double underlierUnits,
final double claimUnits)
final double underlierUnits)
throws Exception
{
if (!NumberUtil.IsValid (_moneyMarketUnits = moneyMarketUnits) ||
!NumberUtil.IsValid (_underlierUnits = underlierUnits) ||
!NumberUtil.IsValid (_claimUnits = claimUnits)) {
!NumberUtil.IsValid (_underlierUnits = underlierUnits)) {
throw new Exception ("InventoryVertex Constructor => Invalid Inputs");
}
}
Expand All @@ -162,15 +158,4 @@ public double underlierUnits()
{
return _underlierUnits;
}

/**
* Retrieve the Number of Claim Units
*
* @return Number of Claim Units
*/

public double claimUnits()
{
return _claimUnits;
}
}
18 changes: 8 additions & 10 deletions src/main/java/org/drip/oms/indifference/PositionVertex.java
Original file line number Diff line number Diff line change
@@ -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 -*-
*/
Expand Down Expand Up @@ -114,30 +112,30 @@
public class PositionVertex
{
private InventoryVertex _inventory = null;
private R1ToR1 _claimsPayoffFunction = null;
private RealizationVertex _realization = null;
private ClaimsPositionPricer _claimsPositionPricer = null;

/**
* PositionVertex Constructor
*
* @param inventory Inventory Vertex
* @param realization Realization Vertex
* @param claimsPayoffFunction Claims Payoff Function
* @param claimsPositionPricer Claims Position Pricer
*
* @throws Exception Thrown if the Inputs are Invalid
*/

public PositionVertex (
final InventoryVertex inventory,
final RealizationVertex realization,
final R1ToR1 claimsPayoffFunction)
final ClaimsPositionPricer claimsPositionPricer)
throws Exception
{
if (null == (_inventory = inventory) || null == (_realization = realization)) {
throw new Exception ("PositionVertex Constructor => Invalid Inputs");
}

_claimsPayoffFunction = claimsPayoffFunction;
_claimsPositionPricer = claimsPositionPricer;
}

/**
Expand Down Expand Up @@ -168,9 +166,9 @@ public RealizationVertex realization()
* @return The Claims Payoff Function
*/

public R1ToR1 claimsPayoffFunction()
public ClaimsPositionPricer claimsPositionPricer()
{
return _claimsPayoffFunction;
return _claimsPositionPricer;
}

/**
Expand Down Expand Up @@ -206,8 +204,8 @@ public double underlierValue()
public double claimsValue()
throws Exception
{
return null == _claimsPayoffFunction ? 0. :
_inventory.claimUnits() * _claimsPayoffFunction.evaluate (_realization.underlierPrice());
return null == _claimsPositionPricer ? 0. :
_claimsPositionPricer.payoffFunction().evaluate (_realization.underlierPrice());
}

/**
Expand Down
Loading

0 comments on commit 514a5d2

Please sign in to comment.