diff options
Diffstat (limited to 'python/analytics/basket_index.py')
| -rw-r--r-- | python/analytics/basket_index.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/analytics/basket_index.py b/python/analytics/basket_index.py index 032a24cd..8122fffb 100644 --- a/python/analytics/basket_index.py +++ b/python/analytics/basket_index.py @@ -121,7 +121,9 @@ class BasketIndex(CreditIndex): @property def recovery_rates(self): - return np.array([c.recovery_rates[0] for c in self.curves]) + # we don't always have the 6 months data point + # so pick arbitrarily the 1 year point + return np.array([c.recovery_rates[1] for c in self.curves]) def pv(self, maturity=None, epsilon=0., coupon=None): if maturity is None: @@ -174,9 +176,9 @@ class BasketIndex(CreditIndex): if theta_date is provided, computes the theta to that specific date instead of one-year theta""" - if hasattr(self, "index_quotes"): + try: index_quotes = self._get_quotes() - else: + except ValueError: index_quotes = {} if maturity is None: r = [] |
