aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics')
-rw-r--r--python/analytics/tranche_basket.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 1812e936..a356cd9e 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -1136,7 +1136,9 @@ class TrancheBasket(BasketIndex):
break
elif skew_type == "topdown":
for j in range(len(dK) - 1, 0, -1):
- cl, pl = self.tranche_legs(self.K[j + 1], self.rho[j + 1])
+ cl, pl = self.tranche_legs(
+ self.K[j + 1], self.rho[j + 1], complement=True
+ )
q = (
self.tranche_quotes.quotes.iat[j] * dK[j]
- pl
@@ -1146,17 +1148,11 @@ class TrancheBasket(BasketIndex):
aux,
0.0,
1.0,
- args=(
- self,
- self.K[j],
- q,
- self.tranche_quotes.running.iat[j],
- False,
- ),
+ args=(self, self.K[j], q, self.tranche_quotes.running.iat[j], True),
full_output=True,
)
if r.converged:
- self.rho[j + 1] = x0
+ self.rho[j] = x0
else:
print(r.flag)
break