aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics')
-rw-r--r--python/analytics/option.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/analytics/option.py b/python/analytics/option.py
index f151335f..ce47bd9c 100644
--- a/python/analytics/option.py
+++ b/python/analytics/option.py
@@ -88,9 +88,10 @@ class Swaption:
(self.sigma * math.sqrt(T))
if self.option_type == "payer":
- Z = Zstar + np.logspace(0, 1.5, 300) - 1
+ Z = Zstar + np.logspace(0, math.log(4 / (self.sigma * math.sqrt(T)), 10), 300) - 1
+ #Z = Zstar + np.logspace(0, 1.5, 300) - 1
elif self.option_type == "receiver":
- Z = Zstar - np.logspace(0, 1.5, 300) + 1
+ Z = Zstar - np.logspace(0, math.log(4 / (self.sigma * math.sqrt(T)), 10), 300) + 1
else:
raise ValueError("option_type needs to be either 'payer' or 'receiver'")
S = S0 * np.exp(-self.sigma**2/2 * T + self.sigma * Z * math.sqrt(T))