diff options
| -rw-r--r-- | python/analytics/tranche_basket.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py index 5af661a9..cea03c73 100644 --- a/python/analytics/tranche_basket.py +++ b/python/analytics/tranche_basket.py @@ -55,8 +55,9 @@ class TrancheBasket(BasketIndex): coupon, recov) self.tranche_quotes.running.iat[i] = coupon - accrued = np.array([cds_accrued(self.value_date, r) for r in self.tranche_quotes.running]) - self.tranche_quotes.quotes -= accrued + self._accrued = np.array([cds_accrued(self.value_date, r) + for r in self.tranche_quotes.running]) + self.tranche_quotes.quotes -= self._accrued self._Ngh = 250 self._Ngrid = 201 @@ -199,18 +200,14 @@ class TrancheBasket(BasketIndex): def tranche_durations(self, complement=False): cl = self.tranche_pvs(complement=complement).coupon_leg - accrued = np.array([cds_accrued(self.value_date, r) - for r in self.tranche_quotes.running]) - durations = (cl - accrued) / self.tranche_quotes.running + durations = (cl - self._accrued) / self.tranche_quotes.running durations.index = self._row_names durations.name = 'duration' return durations def tranche_spreads(self, complement=False): cl, pl, _ = self.tranche_pvs(complement=complement) - accrued = np.array([cds_accrued(self.value_date, r) - for r in self.tranche_quotes.running]) - durations = (cl - accrued) / self.tranche_quotes.running.values + durations = (cl - self._accrued) / self.tranche_quotes.running.values return pd.Series(-pl / durations * 1e4, index=self._row_names, name='spread') @property |
