aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/analytics/tranche_functions.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/python/analytics/tranche_functions.py b/python/analytics/tranche_functions.py
index 9c00c9eb..1b3792b7 100644
--- a/python/analytics/tranche_functions.py
+++ b/python/analytics/tranche_functions.py
@@ -173,7 +173,10 @@ def BCloss_recov_dist(
):
L = np.zeros((Ngrid, defaultprob.shape[1]), order="F")
R = np.zeros_like(L)
- rho = np.full(issuerweights.size, rho)
+ if rho > 1.0:
+ rho = np.ones(issuerweights.size)
+ else:
+ rho = np.full(issuerweights.size, rho)
libloss.BCloss_recov_dist(
defaultprob,
byref(c_int(defaultprob.shape[0])),
@@ -197,7 +200,10 @@ def BCloss_recov_trunc(
):
ELt = np.zeros(defaultprob.shape[1])
ERt = np.zeros_like(ELt)
- rho = np.full(issuerweights.size, rho)
+ if rho > 1.0:
+ rho = np.ones(issuerweights.size)
+ else:
+ rho = np.full(issuerweights.size, rho)
libloss.BCloss_recov_trunc(
defaultprob,
byref(c_int(defaultprob.shape[0])),
@@ -511,7 +517,7 @@ def credit_schedule_pyisda(
def cds_accrued(tradedate, coupon):
- """ computes accrued for a standard CDS
+ """computes accrued for a standard CDS
TODO: fix for when trade_date + 1 = IMM date"""
tradedate = Date.from_datetime(tradedate)