voly 0.0.124__tar.gz → 0.0.126__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.
- {voly-0.0.124/src/voly.egg-info → voly-0.0.126}/PKG-INFO +1 -1
- {voly-0.0.124 → voly-0.0.126}/pyproject.toml +2 -2
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/hd.py +7 -7
- {voly-0.0.124 → voly-0.0.126/src/voly.egg-info}/PKG-INFO +1 -1
- {voly-0.0.124 → voly-0.0.126}/LICENSE +0 -0
- {voly-0.0.124 → voly-0.0.126}/README.md +0 -0
- {voly-0.0.124 → voly-0.0.126}/setup.cfg +0 -0
- {voly-0.0.124 → voly-0.0.126}/setup.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/__init__.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/client.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/__init__.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/charts.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/data.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/fit.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/interpolate.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/core/rnd.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/exceptions.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/formulas.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/models.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/utils/__init__.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly/utils/logger.py +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly.egg-info/SOURCES.txt +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly.egg-info/dependency_links.txt +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly.egg-info/requires.txt +0 -0
- {voly-0.0.124 → voly-0.0.126}/src/voly.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "voly"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.126"
|
|
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.
|
|
63
|
+
python_version = "0.0.126"
|
|
64
64
|
warn_return_any = true
|
|
65
65
|
warn_unused_configs = true
|
|
66
66
|
disallow_untyped_defs = true
|
|
@@ -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
|
-
|
|
224
|
+
rv_surface = {}
|
|
225
225
|
new_x_surface = {}
|
|
226
226
|
all_params = {}
|
|
227
227
|
|
|
228
|
-
# Check if
|
|
229
|
-
if not
|
|
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
|
|
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)) *
|
|
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
|
-
|
|
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
|
|
373
|
+
return rv_surface, x_surface, fit_results
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|