voly 0.0.135__tar.gz → 0.0.136__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.
Files changed (25) hide show
  1. {voly-0.0.135/src/voly.egg-info → voly-0.0.136}/PKG-INFO +1 -1
  2. {voly-0.0.135 → voly-0.0.136}/pyproject.toml +2 -2
  3. {voly-0.0.135 → voly-0.0.136}/src/voly/core/hd.py +8 -5
  4. {voly-0.0.135 → voly-0.0.136/src/voly.egg-info}/PKG-INFO +1 -1
  5. {voly-0.0.135 → voly-0.0.136}/LICENSE +0 -0
  6. {voly-0.0.135 → voly-0.0.136}/README.md +0 -0
  7. {voly-0.0.135 → voly-0.0.136}/setup.cfg +0 -0
  8. {voly-0.0.135 → voly-0.0.136}/setup.py +0 -0
  9. {voly-0.0.135 → voly-0.0.136}/src/voly/__init__.py +0 -0
  10. {voly-0.0.135 → voly-0.0.136}/src/voly/client.py +0 -0
  11. {voly-0.0.135 → voly-0.0.136}/src/voly/core/__init__.py +0 -0
  12. {voly-0.0.135 → voly-0.0.136}/src/voly/core/charts.py +0 -0
  13. {voly-0.0.135 → voly-0.0.136}/src/voly/core/data.py +0 -0
  14. {voly-0.0.135 → voly-0.0.136}/src/voly/core/fit.py +0 -0
  15. {voly-0.0.135 → voly-0.0.136}/src/voly/core/interpolate.py +0 -0
  16. {voly-0.0.135 → voly-0.0.136}/src/voly/core/rnd.py +0 -0
  17. {voly-0.0.135 → voly-0.0.136}/src/voly/exceptions.py +0 -0
  18. {voly-0.0.135 → voly-0.0.136}/src/voly/formulas.py +0 -0
  19. {voly-0.0.135 → voly-0.0.136}/src/voly/models.py +0 -0
  20. {voly-0.0.135 → voly-0.0.136}/src/voly/utils/__init__.py +0 -0
  21. {voly-0.0.135 → voly-0.0.136}/src/voly/utils/logger.py +0 -0
  22. {voly-0.0.135 → voly-0.0.136}/src/voly.egg-info/SOURCES.txt +0 -0
  23. {voly-0.0.135 → voly-0.0.136}/src/voly.egg-info/dependency_links.txt +0 -0
  24. {voly-0.0.135 → voly-0.0.136}/src/voly.egg-info/requires.txt +0 -0
  25. {voly-0.0.135 → voly-0.0.136}/src/voly.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voly
3
- Version: 0.0.135
3
+ Version: 0.0.136
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.135"
7
+ version = "0.0.136"
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.135"
63
+ python_version = "0.0.136"
64
64
  warn_return_any = true
65
65
  warn_unused_configs = true
66
66
  disallow_untyped_defs = true
@@ -473,18 +473,20 @@ def get_garch_hd_surface(model_results: pd.DataFrame,
473
473
  r = model_results.loc[i, 'r'] # Risk-free rate
474
474
  t = model_results.loc[i, 't'] # Time to maturity in years
475
475
 
476
- tau_day = int(t * 365.25) # Convert years to days
476
+ # Fix for very short-term maturities - use floating-point days
477
+ tau_days_float = t * 365.25 # Exact number of days (as float)
478
+ tau_day = max(1, int(tau_days_float)) # Ensure minimum of 1 day for simulation
477
479
 
478
- logger.info(f"Processing GARCH HD for maturity {i} (t={t:.4f} years, {tau_day} days)")
480
+ logger.info(f"Processing GARCH HD for maturity {i} (t={t:.4f} years, {tau_days_float:.2f} days)")
479
481
 
480
482
  # Calculate the number of periods that match the time to expiry
481
- n_periods = int(t * 365.25 * 24 * 60 / minutes_per_period)
483
+ n_periods = max(1, int(t * 365.25 * 24 * 60 / minutes_per_period))
482
484
 
483
485
  # Initialize GARCH model
484
486
  garch_model = GARCHModel(
485
487
  data=log_returns,
486
488
  data_name=str(i),
487
- n_fits=min(n_fits, len(log_returns) // 3), # Ensure we have enough data
489
+ n_fits=min(n_fits, len(log_returns) // 3),
488
490
  window_length=min(window_length, len(log_returns) // 3),
489
491
  z_h=0.1
490
492
  )
@@ -497,7 +499,8 @@ def get_garch_hd_surface(model_results: pd.DataFrame,
497
499
  )
498
500
 
499
501
  # Scale the simulated returns to match target time horizon
500
- scaling_factor = np.sqrt(n_periods / tau_day)
502
+ # Use floating-point days to avoid division by zero
503
+ scaling_factor = np.sqrt(n_periods / tau_days_float)
501
504
  scaled_log_returns = simulated_log_returns * scaling_factor
502
505
 
503
506
  # Risk-neutral adjustment (Girsanov transformation)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voly
3
- Version: 0.0.135
3
+ Version: 0.0.136
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