voly 0.0.141__tar.gz → 0.0.143__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.141/src/voly.egg-info → voly-0.0.143}/PKG-INFO +1 -1
- {voly-0.0.141 → voly-0.0.143}/pyproject.toml +2 -2
- {voly-0.0.141 → voly-0.0.143}/src/voly/client.py +5 -22
- voly-0.0.143/src/voly/core/hd.py +636 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/core/rnd.py +56 -43
- {voly-0.0.141 → voly-0.0.143/src/voly.egg-info}/PKG-INFO +1 -1
- voly-0.0.141/src/voly/core/hd.py +0 -455
- {voly-0.0.141 → voly-0.0.143}/LICENSE +0 -0
- {voly-0.0.141 → voly-0.0.143}/README.md +0 -0
- {voly-0.0.141 → voly-0.0.143}/setup.cfg +0 -0
- {voly-0.0.141 → voly-0.0.143}/setup.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/__init__.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/core/__init__.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/core/charts.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/core/data.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/core/fit.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/core/interpolate.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/exceptions.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/formulas.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/models.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/utils/__init__.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly/utils/logger.py +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly.egg-info/SOURCES.txt +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly.egg-info/dependency_links.txt +0 -0
- {voly-0.0.141 → voly-0.0.143}/src/voly.egg-info/requires.txt +0 -0
- {voly-0.0.141 → voly-0.0.143}/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.143"
|
|
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.143"
|
|
64
64
|
warn_return_any = true
|
|
65
65
|
warn_unused_configs = true
|
|
66
66
|
disallow_untyped_defs = true
|
|
@@ -343,30 +343,11 @@ class VolyClient:
|
|
|
343
343
|
df_hist: pd.DataFrame,
|
|
344
344
|
domain_params: Tuple[float, float, int] = (-1.5, 1.5, 1000),
|
|
345
345
|
return_domain: str = 'log_moneyness',
|
|
346
|
-
method: str = '
|
|
346
|
+
method: str = 'arch_returns',
|
|
347
|
+
model_type: str = 'garch',
|
|
348
|
+
distribution: str = 'normal',
|
|
347
349
|
**kwargs) -> Dict[str, Any]:
|
|
348
|
-
"""
|
|
349
|
-
Generate historical density surface from historical price data.
|
|
350
|
-
|
|
351
|
-
Parameters:
|
|
352
|
-
model_results: DataFrame with model parameters and maturities
|
|
353
|
-
df_hist: DataFrame with historical price data
|
|
354
|
-
domain_params: Tuple of (min, max, num_points) for x-domain
|
|
355
|
-
return_domain: Domain for x-axis values ('log_moneyness', 'moneyness', 'returns', 'strikes')
|
|
356
|
-
method: Method to use for HD estimation ('hist_returns' or 'garch')
|
|
357
|
-
**kwargs: Additional parameters for specific methods:
|
|
358
|
-
For 'garch' method:
|
|
359
|
-
n_fits: Number of sliding windows (default: 400)
|
|
360
|
-
simulations: Number of Monte Carlo simulations (default: 5000)
|
|
361
|
-
window_length: Length of sliding windows (default: 365)
|
|
362
|
-
variate_parameters: Whether to vary GARCH parameters (default: True)
|
|
363
|
-
bandwidth: KDE bandwidth (default: 'silverman')
|
|
364
|
-
For 'hist_returns' method:
|
|
365
|
-
bandwidth: KDE bandwidth (default: 'silverman')
|
|
366
350
|
|
|
367
|
-
Returns:
|
|
368
|
-
Dictionary containing pdf_surface, cdf_surface, x_surface, and moments
|
|
369
|
-
"""
|
|
370
351
|
logger.info(f"Calculating historical density surface using {method} method")
|
|
371
352
|
|
|
372
353
|
return get_hd_surface(
|
|
@@ -375,5 +356,7 @@ class VolyClient:
|
|
|
375
356
|
domain_params=domain_params,
|
|
376
357
|
return_domain=return_domain,
|
|
377
358
|
method=method,
|
|
359
|
+
model_type=model_type,
|
|
360
|
+
distribution=distribution,
|
|
378
361
|
**kwargs
|
|
379
362
|
)
|