aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/analytics/tranche_basket.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 6808220d..0a4ae8ae 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 = deepcopy(self.rho)
+ orig_rho = self.rho
r = []
actual_params = [p for p in params if hasattr(self, p)]
orig_curves = self._index.curves
@@ -249,8 +249,7 @@ class DualCorrTranche():
self._index.tweak_portfolio(ss, self.maturity, False)
for corrs in corr_shock:
#also need to map skew
- for n, rho in enumerate(orig_rho):
- self.rho[n] = rho + corrs if rho else rho
+ self.rho = [None if rho is None else rho + corrs for rho in orig_rho]
r.append([getattr(self, p) for p in actual_params])
self._index.curves = orig_curves
self.rho = orig_rho