voly 0.0.98__tar.gz → 0.0.99__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.98
3
+ Version: 0.0.99
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "voly"
7
- version = "0.0.98"
7
+ version = "0.0.99"
8
8
  description = "Options & volatility research package"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -60,7 +60,7 @@ line_length = 100
60
60
  multi_line_output = 3
61
61
 
62
62
  [tool.mypy]
63
- python_version = "0.0.98"
63
+ python_version = "0.0.99"
64
64
  warn_return_any = true
65
65
  warn_unused_configs = true
66
66
  disallow_untyped_defs = true
@@ -14,12 +14,12 @@ from voly.formulas import get_domain
14
14
 
15
15
  # Breeden-Litzenberger Method
16
16
  @catch_exception
17
- def breeden(domain_params, s, o, r, t, return_domain):
18
- LM = get_domain(domain_params, s, o, r, t, 'log_moneyness')
19
- M = get_domain(domain_params, s, o, r, t, 'moneyness')
20
- R = get_domain(domain_params, s, o, r, t, 'returns')
21
- K = get_domain(domain_params, s, o, r, t, 'strikes')
22
- D = get_domain(domain_params, s, o, r, t, 'delta')
17
+ def breeden(domain_params, s, r, o, t, return_domain):
18
+ LM = get_domain(domain_params, s, r, o, t, 'log_moneyness')
19
+ M = get_domain(domain_params, s, r, o, t, 'moneyness')
20
+ R = get_domain(domain_params, s, r, o, t, 'returns')
21
+ K = get_domain(domain_params, s, r, o, t, 'strikes')
22
+ D = get_domain(domain_params, s, r, o, t, 'delta')
23
23
 
24
24
  c = voly.bs(s, K, r, o, t, option_type='call')
25
25
  c1 = np.gradient(c, K)
@@ -72,12 +72,12 @@ def breeden(domain_params, s, o, r, t, return_domain):
72
72
 
73
73
  # Rookley's Method
74
74
  @catch_exception
75
- def rookley(domain_params, s, o, r, t, return_domain):
76
- LM = get_domain(domain_params, s, o, r, t, 'log_moneyness')
77
- M = get_domain(domain_params, s, o, r, t, 'moneyness')
78
- R = get_domain(domain_params, s, o, r, t, 'returns')
79
- K = get_domain(domain_params, s, o, r, t, 'strikes')
80
- D = get_domain(domain_params, s, o, r, t, 'delta')
75
+ def rookley(domain_params, s, r, o, t, return_domain):
76
+ LM = get_domain(domain_params, s, r, o, t, 'log_moneyness')
77
+ M = get_domain(domain_params, s, r, o, t, 'moneyness')
78
+ R = get_domain(domain_params, s, r, o, t, 'returns')
79
+ K = get_domain(domain_params, s, r, o, t, 'strikes')
80
+ D = get_domain(domain_params, s, r, o, t, 'delta')
81
81
 
82
82
  o1 = np.gradient(o, M)
83
83
  o2 = np.gradient(o1, M)
@@ -111,8 +111,8 @@ def rookley(domain_params, s, o, r, t, return_domain):
111
111
  d_c_M = stats.norm.pdf(d1) * d_d1_M - 1 / ert * stats.norm.pdf(d2) / M * d_d2_M + 1 / ert * stats.norm.cdf(d2) / (
112
112
  M ** 2)
113
113
  dd_c_M = (
114
- stats.norm.pdf(d1) * (dd_d1_M - d1 * (d_d1_M) ** 2)
115
- - stats.norm.pdf(d2) / (ert * M) * (dd_d2_M - 2 / M * d_d2_M - d2 * (d_d2_M) ** 2)
114
+ stats.norm.pdf(d1) * (dd_d1_M - d1 * d_d1_M ** 2)
115
+ - stats.norm.pdf(d2) / (ert * M) * (dd_d2_M - 2 / M * d_d2_M - d2 * d_d2_M ** 2)
116
116
  - 2 * stats.norm.cdf(d2) / (ert * M ** 3)
117
117
  )
118
118
 
@@ -270,9 +270,9 @@ def get_rnd_surface(model_results: pd.DataFrame,
270
270
  o = np.sqrt(w / t)
271
271
 
272
272
  if method == 'rookley':
273
- pdf, cdf, x, moments = rookley(domain_params, s, o, r, t, return_domain)
273
+ pdf, cdf, x, moments = rookley(domain_params, s, r, o, t, return_domain)
274
274
  else:
275
- pdf, cdf, x, moments = breeden(domain_params, s, o, r, t, return_domain)
275
+ pdf, cdf, x, moments = breeden(domain_params, s, r, o, t, return_domain)
276
276
 
277
277
  pdf_surface[i] = pdf
278
278
  cdf_surface[i] = cdf
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.98
3
+ Version: 0.0.99
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes