aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics')
-rw-r--r--python/analytics/tranche_basket.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 9ec1a2b5..6ee49580 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -1288,6 +1288,14 @@ class TrancheBasket(BasketIndex):
self.rho = rho_saved
return corr01
+ def implied_ss(self):
+ return (
+ self.index_pv(clean=True).bond_price
+ - np.diff(self.K)[0] * self.tranche_pvs().bond_price[0]
+ - np.diff(self.K)[1] * self.tranche_pvs().bond_price[1]
+ - np.diff(self.K)[2] * self.tranche_pvs().bond_price[2]
+ ) / np.diff(self.K)[3]
+
def build_skew(self, skew_type="bottomup"):
assert skew_type == "bottomup" or skew_type == "topdown"
dK = np.diff(self.K)