aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/tranche_basket.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/tranche_basket.py')
-rw-r--r--python/analytics/tranche_basket.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 1af4d4eb..6808220d 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -241,7 +241,7 @@ class DualCorrTranche():
return "\n".join(s)
def shock(self, params=['pnl'], *, spread_shock, corr_shock, **kwargs):
- orig_rho = self.rho
+ orig_rho = deepcopy(self.rho)
r = []
actual_params = [p for p in params if hasattr(self, p)]
orig_curves = self._index.curves
@@ -249,7 +249,8 @@ class DualCorrTranche():
self._index.tweak_portfolio(ss, self.maturity, False)
for corrs in corr_shock:
#also need to map skew
- self.rho = orig_rho * (1 + corrs)
+ for n, rho in enumerate(orig_rho):
+ self.rho[n] = rho + corrs if rho else rho
r.append([getattr(self, p) for p in actual_params])
self._index.curves = orig_curves
self.rho = orig_rho