aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics')
-rw-r--r--python/analytics/tranche_basket.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 6ab730a3..f5dff6de 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -441,6 +441,18 @@ class DualCorrTranche:
+ self.tranche_running * 1e-4 * days_accrued
)
+ @property
+ def corr01(self):
+ orig_pv = self.pv
+ orig_rho = self.rho
+ eps = 0.01
+ # multiplicative version
+ # self.rho = np.power(self.rho, 1 - eps)
+ self.rho += eps
+ corr01 = self.pv - orig_pv
+ self.rho = orig_rho
+ return corr01
+
def __repr__(self):
s = [
f"{self.index_type}{self.series} {self.tenor} Tranche",