diff options
Diffstat (limited to 'python/analytics')
| -rw-r--r-- | python/analytics/tranche_basket.py | 3 | ||||
| -rw-r--r-- | python/analytics/tranche_functions.py | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py index 1255f639..1913c1d1 100644 --- a/python/analytics/tranche_basket.py +++ b/python/analytics/tranche_basket.py @@ -1,12 +1,13 @@ from .basket_index import BasketIndex from .db import _engine from .tranche_functions import ( - credit_schedule, adjust_attachments, cds_accrued, GHquad, BCloss_recov_dist, + credit_schedule, adjust_attachments, GHquad, BCloss_recov_dist, BCloss_recov_trunc, tranche_cl, tranche_pl) from .index_data import get_singlenames_curves, get_tranche_quotes from collections import namedtuple from copy import deepcopy from pandas.tseries.offsets import BDay +from pyisda.date import cds_accrued from scipy.optimize import brentq from scipy.interpolate import CubicSpline, PchipInterpolator from scipy.special import logit, expit diff --git a/python/analytics/tranche_functions.py b/python/analytics/tranche_functions.py index ec097c3c..21c7b328 100644 --- a/python/analytics/tranche_functions.py +++ b/python/analytics/tranche_functions.py @@ -334,6 +334,9 @@ def credit_schedule(tradedate, tenor, coupon, yc, enddate=None): return pydates[0], pd.DataFrame({"df": df, "coupons": coupons}, dates[1:]) def cds_accrued(tradedate, coupon): + """ computes accrued for a standard CDS + + TODO: fix for when trade_date + 1 = IMM date""" tradedate = pydate_to_qldate(tradedate) end = tradedate + Period('3M') |
