aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/analytics/tranche_basket.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index aeb51453..8297f83d 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -79,7 +79,7 @@ class Skew():
return s
class DualCorrTranche():
- _cache = LRU(64)
+ _cache = LRU(512)
_Legs = namedtuple('Legs', 'coupon_leg, protection_leg, bond_price')
def __init__(self, index_type: str=None, series: int=None,
@@ -497,6 +497,7 @@ class DualCorrTranche():
else:
return np.diff(np.hstack((0., ELvec))) @ df
+ @memoize(hasher=lambda args: (hash(args[0]._index), *args[1:]))
def expected_loss_trunc(self, K, rho=None, shortened=0):
if rho is None:
rho = self._skew(K)