aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/analytics/tranche_basket.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 1dafd834..93cf32cc 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -158,18 +158,13 @@ class TrancheBasket(BasketIndex):
def expected_loss_trunc(self, K, rho=None):
if rho is None:
rho = expit(self._skew(logit(K)))
- L, _ = BCloss_recov_dist(self.default_prob.values,
- self.weights,
- self.recovery_rates,
- rho,
- self._Z, self._w, self._Ngrid)
- Ltrunc, _ = BCloss_recov_trunc(self.default_prob.values,
- self.weights,
- self.recovery_rates,
- rho,
- K,
- self._Z, self._w, self._Ngrid)
- return - tranche_pl(L, self.cs, 0., K), Ltrunc
+ ELt, _ = BCloss_recov_trunc(self.default_prob.values,
+ self.weights,
+ self.recovery_rates,
+ rho,
+ K,
+ self._Z, self._w, self._Ngrid)
+ return - np.dot(np.diff(np.hstack((K, ELt))), self.cs.df)
@property
@@ -247,3 +242,5 @@ class TrancheBasket(BasketIndex):
if method == "ATM":
K1eq = el1 / el2 * index2.K[1:-1]
+ # elif method == "TLP":
+ # pass