voly 0.0.124__py3-none-any.whl → 0.0.127__py3-none-any.whl

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.
voly/client.py CHANGED
@@ -392,7 +392,7 @@ class VolyClient:
392
392
  logger.info("Calculating realized volatility surface")
393
393
 
394
394
  # Generate the surface
395
- fit_results, iv_surface, x_surface = get_rv_surface(
395
+ fit_results, rv_surface, x_surface = get_rv_surface(
396
396
  model_results=model_results,
397
397
  pdf_surface=pdf_surface,
398
398
  x_surface=x_surface,
@@ -402,6 +402,6 @@ class VolyClient:
402
402
 
403
403
  return {
404
404
  'fit_results': fit_results,
405
- 'iv_surface': iv_surface,
405
+ 'rv_surface': rv_surface,
406
406
  'x_surface': x_surface
407
407
  }
voly/core/hd.py CHANGED
@@ -221,18 +221,18 @@ def get_rv_surface(model_results: pd.DataFrame,
221
221
  if missing_columns:
222
222
  raise VolyError(f"Required columns missing in model_results: {missing_columns}")
223
223
 
224
- iv_surface = {}
224
+ rv_surface = {}
225
225
  new_x_surface = {}
226
226
  all_params = {}
227
227
 
228
- # Check if hd_surface is empty
229
- if not hd_surface:
228
+ # Check if pdf_surface is empty
229
+ if not pdf_surface:
230
230
  logger.warning("Historical density surface is empty.")
231
231
  return {}, {}, pd.DataFrame()
232
232
 
233
233
  # Process each maturity
234
234
  for i in model_results.index:
235
- if i not in hd_surface:
235
+ if i not in pdf_surface:
236
236
  logger.warning(f"No historical density available for maturity {i}, skipping.")
237
237
  continue
238
238
 
@@ -256,7 +256,7 @@ def get_rv_surface(model_results: pd.DataFrame,
256
256
  for j, lm_k in enumerate(LM):
257
257
  mask = LM >= lm_k
258
258
  if np.any(mask):
259
- integrand = s * (np.exp(LM[mask]) - np.exp(lm_k)) * hd[mask]
259
+ integrand = s * (np.exp(LM[mask]) - np.exp(lm_k)) * pdf[mask]
260
260
  c_recovered[j] = np.exp(-r * t) * np.trapz(integrand, LM[mask])
261
261
 
262
262
  # Ensure call prices are at least the intrinsic value
@@ -352,7 +352,7 @@ def get_rv_surface(model_results: pd.DataFrame,
352
352
  o_recovered = np.sqrt(w / t)
353
353
 
354
354
  # Store results
355
- iv_surface[i] = o_recovered
355
+ rv_surface[i] = o_recovered
356
356
 
357
357
  if return_domain == 'log_moneyness':
358
358
  x = LM
@@ -370,4 +370,4 @@ def get_rv_surface(model_results: pd.DataFrame,
370
370
  # Create a DataFrame with parameters
371
371
  fit_results = pd.DataFrame(all_params).T
372
372
  x_surface = new_x_surface
373
- return iv_surface, x_surface, fit_results
373
+ return fit_results, rv_surface, x_surface
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voly
3
- Version: 0.0.124
3
+ Version: 0.0.127
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
1
  voly/__init__.py,sha256=8xyDk7rFCn_MOD5hxuv5cxxKZvBVRiSIM7TgaMPpwpw,211
2
- voly/client.py,sha256=3Qe_fLkBTEPHzZ9rZdXd4u4xhaIpQGesn1XjkcBIk1A,14887
2
+ voly/client.py,sha256=R5QSKSJhwYYoJe9LFPL9dynOVwz0q6LI8TU--vnsILs,14887
3
3
  voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
4
4
  voly/formulas.py,sha256=HejPfgVh6-hmWDhvwbHgAIfQMt8iPbIiaKqcBrB5Spw,10766
5
5
  voly/models.py,sha256=BF-O7BjGf0BLMpw4rCtfwW7s8_f4iyUZdUY6q1dVxLs,3363
@@ -7,13 +7,13 @@ voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
7
7
  voly/core/charts.py,sha256=E21OZB5lTY4YL2flgaFJ6s5g3_ExtAQT2zryZZxLPyM,12735
8
8
  voly/core/data.py,sha256=pDeuYhP0GX4RbtlqByvsE3rfHcIkix0BU5MLW8sKIeI,8935
9
9
  voly/core/fit.py,sha256=Tb9eeG7e_2dQTcqt6aqEwFrZdy6jR9rSNqe6tzOdVhQ,9245
10
- voly/core/hd.py,sha256=ODaDW95V_jq-yja-arJi1llgvf7Yq0RTGnjSyn6HEsw,13455
10
+ voly/core/hd.py,sha256=nU_sjOn-DVRFNmjUiZfeMf-RJehm-I0HrqfOmupINiw,13459
11
11
  voly/core/interpolate.py,sha256=JkK172-FXyhesW3hY4pEeuJWG3Bugq7QZXbeKoRpLuo,5305
12
12
  voly/core/rnd.py,sha256=0VE77lxesx_BPAO46QwKpcauZNaHnPTiDhmRbSURn3c,10022
13
13
  voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
14
14
  voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
15
- voly-0.0.124.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
16
- voly-0.0.124.dist-info/METADATA,sha256=OgVZEuKHA8iCCB56Y4r77eAT6oCr3lhegeq0WguT2CA,4115
17
- voly-0.0.124.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
18
- voly-0.0.124.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
19
- voly-0.0.124.dist-info/RECORD,,
15
+ voly-0.0.127.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
16
+ voly-0.0.127.dist-info/METADATA,sha256=8s8R7TsvT7fLIhVumViAOTfJ3ofzCJshQBc2QrFOx3k,4115
17
+ voly-0.0.127.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
18
+ voly-0.0.127.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
19
+ voly-0.0.127.dist-info/RECORD,,
File without changes