aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/tranche_functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/tranche_functions.py')
-rw-r--r--python/analytics/tranche_functions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/analytics/tranche_functions.py b/python/analytics/tranche_functions.py
index 8c02c46c..e9ee3ddc 100644
--- a/python/analytics/tranche_functions.py
+++ b/python/analytics/tranche_functions.py
@@ -116,6 +116,13 @@ libloss.shockprob.argtypes = [
c_double,
c_int]
+libloss.shockseverity.restype = c_double
+libloss.shockseverity.argtypes = [
+ c_double,
+ c_double,
+ c_double,
+ c_double]
+
def GHquad(n):
Z, w = h_roots(n)
return Z*np.sqrt(2), w/np.sqrt(np.pi)
@@ -134,6 +141,9 @@ def fitprob(Z, w, rho, p0):
def shockprob(p, rho, Z, give_log):
return libloss.shockprob(c_double(p), c_double(rho), c_double(Z), c_int(give_log))
+def shockseverity(S, rho, Z, p):
+ return libloss.shockseverity(c_double(S), c_double(rho), c_double(Z), c_double(p))
+
def BCloss_recov_dist(defaultprob, issuerweights, recov, rho, Z, w, Ngrid=101, defaultflag=False):
L = np.zeros((Ngrid, defaultprob.shape[1]), order='F')
R = np.zeros_like(L)