diff options
Diffstat (limited to 'python/analytics')
| -rw-r--r-- | python/analytics/basket_index.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/analytics/basket_index.py b/python/analytics/basket_index.py index 84286843..23ed3be1 100644 --- a/python/analytics/basket_index.py +++ b/python/analytics/basket_index.py @@ -201,6 +201,16 @@ class BasketIndex(CreditIndex): r, index=self.index_desc.tenor, name="gini" if use_gini else "dispersion" ) + def accrued(self, maturity=None): + if maturity is None: + r = [] + for m in self.maturities: + coupon = self.index_desc.coupon[m] + r.append(super().accrued(coupon)) + return pd.Series(r, index=self.index_desc.tenor, name="accrued") + else: + return super().accrued(self.index_desc.coupon[maturity]) + def pv(self, maturity=None, epsilon=0.0, coupon=None): if maturity is None: r = [] |
