aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/analytics/option.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/python/analytics/option.py b/python/analytics/option.py
index e2bafee8..7d5c8a7b 100644
--- a/python/analytics/option.py
+++ b/python/analytics/option.py
@@ -610,11 +610,8 @@ def _calibrate_model(index, quotes, option_type, option_model,
non_nan = ~np.isnan(vol)
vol = vol[non_nan]
moneyness = np.log(data[non_nan,1])
- if moneyness.size <= 5:
- interp_kind = 'linear'
- else:
- interp_kind = 'cubic'
- h.append(interp1d(moneyness, vol, kind=interp_kind, fill_value="extrapolate"))
+ h.append(interp1d(moneyness, vol,
+ kind='linear', fill_value="extrapolate"))
return BivariateLinearFunction(T, h)
else:
raise ValueError("interp_method needs to be one of 'bivariate_spline' or 'bivariate_linear'")
@@ -645,7 +642,8 @@ class ModelBasedVolSurface(VolSurface):
elif type(self) is SABRVolSurface:
self._opts = {'beta': 3.19 if index_type == "HY" else 1.84}
else:
- raise TypeError("class needs to be SwaptionVolSurface, BlackSwaptionVolSurface or SABRVolSurface")
+ raise TypeError("class needs to be SwaptionVolSurface, "
+ "BlackSwaptionVolSurface or SABRVolSurface")
def list(self, source=None, option_type=None):
"""returns list of vol surfaces"""