diff options
Diffstat (limited to 'python/analytics/tranche_basket.py')
| -rw-r--r-- | python/analytics/tranche_basket.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py index 64fc03dd..e2759b69 100644 --- a/python/analytics/tranche_basket.py +++ b/python/analytics/tranche_basket.py @@ -193,7 +193,12 @@ class DualCorrTranche(): dK = np.diff(self.K) pl = np.diff(pl) / dK cl = np.diff(cl) / dK * self.tranche_running * 1e-4 - return pl, cl + return float(pl), float(cl) + + @property + def spread(self): + pl, cl = self._pv() + return -pl / self.duration @property def upfront(self): @@ -286,7 +291,7 @@ class DualCorrTranche(): @property def duration(self): - return self._pv()[1] - self._accrued + return (self._pv()[1] - self._accrued) / (self.tranche_running * 1e-4) @property def hy_equiv(self): |
