aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/analytics/tranche_functions.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/analytics/tranche_functions.py b/python/analytics/tranche_functions.py
index a625949f..7910a1d0 100644
--- a/python/analytics/tranche_functions.py
+++ b/python/analytics/tranche_functions.py
@@ -68,8 +68,8 @@ libloss.BCloss_recov_trunc.argtypes = [
POINTER(c_int), # Ngrid
POINTER(c_double), #K
POINTER(c_int), #defaultflag
- ndpointer('double', ndim=2, flags='F,writeable'),# output L
- ndpointer('double', ndim=2, flags='F,writeable')# output R
+ ndpointer('double', ndim=1, flags='F,writeable'),# output L
+ ndpointer('double', ndim=1, flags='F,writeable')# output R
]
libloss.lossdistrib_joint.restype = None
@@ -135,16 +135,16 @@ def BCloss_recov_dist(defaultprob, issuerweights, recov, rho, Z, w, Ngrid=101, d
return L, R
def BCloss_recov_trunc(defaultprob, issuerweights, recov, rho, K, Z, w, Ngrid=101, defaultflag=False):
- L = np.zeros((Ngrid, defaultprob.shape[1]), order='F')
- R = np.zeros_like(L)
+ ELt = np.zeros(defaultprob.shape[1])
+ ERt = np.zeros_like(ELt)
rho = np.full(issuerweights.size, rho)
libloss.BCloss_recov_trunc(defaultprob, byref(c_int(defaultprob.shape[0])),
byref(c_int(defaultprob.shape[1])),
issuerweights, recov, Z, w, byref(c_int(Z.size)),
rho, byref(c_int(Ngrid)), byref(c_double(K)),
byref(c_int(defaultflag)),
- L, R)
- return L, R
+ ELt, ERt)
+ return ELt, ERt
def lossdistrib_joint(p, pp, w, S, Ngrid=101, defaultflag=False):
"""Joint loss-recovery distribution recursive algorithm.