diff options
| -rw-r--r-- | python/analytics/basket_index.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/analytics/basket_index.py b/python/analytics/basket_index.py index 4c3ba6a1..15be4b55 100644 --- a/python/analytics/basket_index.py +++ b/python/analytics/basket_index.py @@ -306,7 +306,7 @@ class BasketIndex(CreditIndex): ) def theta(self, maturity=None, coupon=None, theta_date=None): - """ index thetas + """index thetas if maturity is None, returns a series of theta for all tenors. Otherwise computes the theta for that specific maturity (which needs @@ -396,6 +396,8 @@ class BasketIndex(CreditIndex): continue self.tweaks.append(eps) self.tweak_portfolio(eps, m) + if np.all(np.isnan(self.tweaks)): + raise ValueError("couldn't tweak index") def _snacpv(self, spread, coupon, recov, maturity): return upfront_charge( |
