Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
Bug Fixes/Re-organization:

	- XVA Topology Collateral Group (1, 2, 3)
	- XVA Topology Credit Debt Group #1 (4, 5)
	- XVA Topology Credit Debt Group #2 (6, 7)
	- XVA Topology Funding Group #1 (8, 9)
	- XVA Topology Funding Group #2 (10, 11)
	- XVA Topology Adiabat Market Parameters #1 (12, 13, 14)
	- XVA Topology Adiabat Market Parameters #2 (15, 16)
	- XVA Topology Adiabat #1 (17, 18)
	- XVA Topology Adiabat #2 (19, 20)
	- XVA Vertex Albanese Andersen (21)
	- XVA Vertex Burgard Kjaer Exposure (22, 23, 24)
	- XVA Vertex Burgard Kjaer (25, 26, 27)
	- XVA Vertex Burgard Kjaer Builder (28, 29)
	- Validation Distance Importance Weight (30, 31)
	- Validation Distance Hypothesis Suite (32, 33)
	- Validation Distance Gap Test Outcome (34, 35)
	- Validation Distance Hypothesis Outcome (36)
	- Validation Distance Hypothesis Outcome Suite (37, 38)
	- Validation Distance Gap Loss Test (39)
	- Validation Distance Gap Loss Weight Function (40)
	- Validation Distance Gap Test Setting (41, 42)
	- Validation Distance README (43, 44)
	- Validation Evidence Test Statistic Evaluator (45)
	- Validation Evidence Test Statistic Accumulator (46, 47)
	- Validation Evidence Native PIT Generator (48)
	- Validation Evidence Sample (49)
	- Validation Evidence Ensemble (50, 51, 52)
	- Validation Hypothesis T Test Outcome (53, 54, 55)
	- Validation Hypothesis Significance Test Setting (56, 57)
	- Validation Hypothesis Significance Test Outcome (58, 59, 60)


Samples:

IdeaDRIP:
  • Loading branch information
Lakshmik committed Dec 16, 2023
1 parent b8e9cb2 commit 7781694
Show file tree
Hide file tree
Showing 28 changed files with 1,014 additions and 1,293 deletions.
40 changes: 40 additions & 0 deletions ReleaseNotes/01_26_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Features:

Bug Fixes/Re-organization:

- XVA Topology Collateral Group (1, 2, 3)
- XVA Topology Credit Debt Group #1 (4, 5)
- XVA Topology Credit Debt Group #2 (6, 7)
- XVA Topology Funding Group #1 (8, 9)
- XVA Topology Funding Group #2 (10, 11)
- XVA Topology Adiabat Market Parameters #1 (12, 13, 14)
- XVA Topology Adiabat Market Parameters #2 (15, 16)
- XVA Topology Adiabat #1 (17, 18)
- XVA Topology Adiabat #2 (19, 20)
- XVA Vertex Albanese Andersen (21)
- XVA Vertex Burgard Kjaer Exposure (22, 23, 24)
- XVA Vertex Burgard Kjaer (25, 26, 27)
- XVA Vertex Burgard Kjaer Builder (28, 29)
- Validation Distance Importance Weight (30, 31)
- Validation Distance Hypothesis Suite (32, 33)
- Validation Distance Gap Test Outcome (34, 35)
- Validation Distance Hypothesis Outcome (36)
- Validation Distance Hypothesis Outcome Suite (37, 38)
- Validation Distance Gap Loss Test (39)
- Validation Distance Gap Loss Weight Function (40)
- Validation Distance Gap Test Setting (41, 42)
- Validation Distance README (43, 44)
- Validation Evidence Test Statistic Evaluator (45)
- Validation Evidence Test Statistic Accumulator (46, 47)
- Validation Evidence Native PIT Generator (48)
- Validation Evidence Sample (49)
- Validation Evidence Ensemble (50, 51, 52)
- Validation Hypothesis T Test Outcome (53, 54, 55)
- Validation Hypothesis Significance Test Setting (56, 57)
- Validation Hypothesis Significance Test Outcome (58, 59, 60)


Samples:

IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
23 changes: 13 additions & 10 deletions src/main/java/org/drip/validation/distance/GapLossFunction.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

package org.drip.validation.distance;

import org.drip.numerical.common.NumberUtil;

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

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -131,11 +136,10 @@ public static final GapLossFunction RiskFactorTest()
{
@Override public double loss (
final double gap)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (gap))
{
throw new java.lang.Exception ("GapLossFunction::loss => Invalid Inputs");
if (!NumberUtil.IsValid (gap)) {
throw new Exception ("GapLossFunction::loss => Invalid Inputs");
}

return gap * gap;
Expand All @@ -157,11 +161,10 @@ public static final GapLossFunction ConservativePortfolioTest()
{
@Override public double loss (
final double gap)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (gap))
{
throw new java.lang.Exception ("GapLossFunction::loss => Invalid Inputs");
if (!NumberUtil.IsValid (gap)) {
throw new Exception ("GapLossFunction::loss => Invalid Inputs");
}

return gap < 0. ? 0. : gap * gap;
Expand All @@ -177,10 +180,10 @@ public static final GapLossFunction ConservativePortfolioTest()
*
* @return The Loss
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
* @throws Exception Thrown if the Inputs are Invalid
*/

public abstract double loss (
final double gap)
throws java.lang.Exception;
throws Exception;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

package org.drip.validation.distance;

import org.drip.numerical.common.NumberUtil;

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

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -130,11 +135,10 @@ public static final GapLossWeightFunction CramersVonMises()
{
@Override public double weight (
final double pValueHypothesis)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (pValueHypothesis))
{
throw new java.lang.Exception ("GapLossWeightFunction::weight => Invalid Inputs");
if (!NumberUtil.IsValid (pValueHypothesis)) {
throw new Exception ("GapLossWeightFunction::weight => Invalid Inputs");
}

return 1.;
Expand All @@ -154,11 +158,10 @@ public static final GapLossWeightFunction AndersonDarling()
{
@Override public double weight (
final double pValueHypothesis)
throws java.lang.Exception
throws Exception
{
if (!org.drip.numerical.common.NumberUtil.IsValid (pValueHypothesis))
{
throw new java.lang.Exception ("GapLossWeightFunction::weight => Invalid Inputs");
if (!NumberUtil.IsValid (pValueHypothesis)) {
throw new Exception ("GapLossWeightFunction::weight => Invalid Inputs");
}

return 0. == pValueHypothesis || 1. == pValueHypothesis ? 0. :
Expand All @@ -175,10 +178,10 @@ public static final GapLossWeightFunction AndersonDarling()
*
* @return The Weight
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
* @throws Exception Thrown if the Inputs are Invalid
*/

public abstract double weight (
final double pValueHypothesis)
throws java.lang.Exception;
throws Exception;
}
34 changes: 17 additions & 17 deletions src/main/java/org/drip/validation/distance/GapTestOutcome.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

package org.drip.validation.distance;

import org.drip.numerical.common.NumberUtil;
import org.drip.validation.hypothesis.ProbabilityIntegralTransform;

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

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -117,11 +123,9 @@

public class GapTestOutcome
{
private double _distance = java.lang.Double.NaN;
private org.drip.validation.hypothesis.ProbabilityIntegralTransform
_probabilityIntegralTransformWeighted = null;
private org.drip.validation.hypothesis.ProbabilityIntegralTransform
_probabilityIntegralTransformUnweighted = null;
private double _distance = Double.NaN;
private ProbabilityIntegralTransform _probabilityIntegralTransformWeighted = null;
private ProbabilityIntegralTransform _probabilityIntegralTransformUnweighted = null;

/**
* GapTestOutcome Constructor
Expand All @@ -131,22 +135,19 @@ public class GapTestOutcome
* Losses
* @param distance Distance Metric
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
* @throws Exception Thrown if the Inputs are Invalid
*/

public GapTestOutcome (
final org.drip.validation.hypothesis.ProbabilityIntegralTransform
probabilityIntegralTransformUnweighted,
final org.drip.validation.hypothesis.ProbabilityIntegralTransform
probabilityIntegralTransformWeighted,
final ProbabilityIntegralTransform probabilityIntegralTransformUnweighted,
final ProbabilityIntegralTransform probabilityIntegralTransformWeighted,
final double distance)
throws java.lang.Exception
throws Exception
{
if (null == (_probabilityIntegralTransformUnweighted = probabilityIntegralTransformUnweighted) ||
null == (_probabilityIntegralTransformWeighted = probabilityIntegralTransformWeighted) ||
!org.drip.numerical.common.NumberUtil.IsValid (_distance = distance))
{
throw new java.lang.Exception ("GapTestOutcome Constructor => Invalid Inputs");
!NumberUtil.IsValid (_distance = distance)) {
throw new Exception ("GapTestOutcome Constructor => Invalid Inputs");
}
}

Expand All @@ -156,8 +157,7 @@ public GapTestOutcome (
* @return The Probability Integral Transform of the Raw Gap Losses
*/

public org.drip.validation.hypothesis.ProbabilityIntegralTransform
probabilityIntegralTransformUnweighted()
public ProbabilityIntegralTransform probabilityIntegralTransformUnweighted()
{
return _probabilityIntegralTransformUnweighted;
}
Expand All @@ -168,7 +168,7 @@ public GapTestOutcome (
* @return The Probability Integral Transform of the Weighted Gap Losses
*/

public org.drip.validation.hypothesis.ProbabilityIntegralTransform probabilityIntegralTransformWeighted()
public ProbabilityIntegralTransform probabilityIntegralTransformWeighted()
{
return _probabilityIntegralTransformWeighted;
}
Expand Down
53 changes: 21 additions & 32 deletions src/main/java/org/drip/validation/distance/GapTestSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

/*!
* Copyright (C) 2025 Lakshmi Krishnamurthy
* Copyright (C) 2024 Lakshmi Krishnamurthy
* Copyright (C) 2023 Lakshmi Krishnamurthy
* Copyright (C) 2022 Lakshmi Krishnamurthy
* Copyright (C) 2021 Lakshmi Krishnamurthy
* Copyright (C) 2020 Lakshmi Krishnamurthy
Expand Down Expand Up @@ -117,8 +120,8 @@

public class GapTestSetting
{
private org.drip.validation.distance.GapLossFunction _lossFunction = null;
private org.drip.validation.distance.GapLossWeightFunction _lossWeightFunction = null;
private GapLossFunction _lossFunction = null;
private GapLossWeightFunction _lossWeightFunction = null;

/**
* Construct the Anfuso Karyampas Nawroth (2017) Risk Factor Loss Test Variant of the Gap Test Setting
Expand All @@ -129,17 +132,11 @@ public class GapTestSetting
*/

public static final GapTestSetting RiskFactorLossTest (
final org.drip.validation.distance.GapLossWeightFunction lossWeightFunction)
final GapLossWeightFunction lossWeightFunction)
{
try
{
return new GapTestSetting (
org.drip.validation.distance.GapLossFunction.RiskFactorTest(),
lossWeightFunction
);
}
catch (java.lang.Exception e)
{
try {
return new GapTestSetting (GapLossFunction.RiskFactorTest(), lossWeightFunction);
} catch (Exception e) {
e.printStackTrace();
}

Expand All @@ -157,17 +154,11 @@ public static final GapTestSetting RiskFactorLossTest (
*/

public static final GapTestSetting ConservativePortfolioLossTest (
final org.drip.validation.distance.GapLossWeightFunction lossWeightFunction)
final GapLossWeightFunction lossWeightFunction)
{
try
{
return new GapTestSetting (
org.drip.validation.distance.GapLossFunction.ConservativePortfolioTest(),
lossWeightFunction
);
}
catch (java.lang.Exception e)
{
try {
return new GapTestSetting (GapLossFunction.ConservativePortfolioTest(), lossWeightFunction);
} catch (Exception e) {
e.printStackTrace();
}

Expand All @@ -180,18 +171,16 @@ public static final GapTestSetting ConservativePortfolioLossTest (
* @param lossFunction Gap Loss Function
* @param lossWeightFunction Gap Loss Weight Function
*
* @throws java.lang.Exception Thrown if the Inputs are Invalid
* @throws Exception Thrown if the Inputs are Invalid
*/

public GapTestSetting (
final org.drip.validation.distance.GapLossFunction lossFunction,
final org.drip.validation.distance.GapLossWeightFunction lossWeightFunction)
throws java.lang.Exception
final GapLossFunction lossFunction,
final GapLossWeightFunction lossWeightFunction)
throws Exception
{
if (null == (_lossFunction = lossFunction) ||
null == (_lossWeightFunction = lossWeightFunction))
{
throw new java.lang.Exception ("GapTestSetting Constructor => Invalid Inputs");
if (null == (_lossFunction = lossFunction) || null == (_lossWeightFunction = lossWeightFunction)) {
throw new Exception ("GapTestSetting Constructor => Invalid Inputs");
}
}

Expand All @@ -201,7 +190,7 @@ public GapTestSetting (
* @return The Gap Loss Function
*/

public org.drip.validation.distance.GapLossFunction lossFunction()
public GapLossFunction lossFunction()
{
return _lossFunction;
}
Expand All @@ -212,7 +201,7 @@ public org.drip.validation.distance.GapLossFunction lossFunction()
* @return The Gap Loss Weight Function
*/

public org.drip.validation.distance.GapLossWeightFunction lossWeightFunction()
public GapLossWeightFunction lossWeightFunction()
{
return _lossWeightFunction;
}
Expand Down
Loading

0 comments on commit 7781694

Please sign in to comment.