voly 0.0.222__py3-none-any.whl → 0.0.223__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/core/hd.py +10 -1
- {voly-0.0.222.dist-info → voly-0.0.223.dist-info}/METADATA +1 -1
- {voly-0.0.222.dist-info → voly-0.0.223.dist-info}/RECORD +6 -6
- {voly-0.0.222.dist-info → voly-0.0.223.dist-info}/WHEEL +0 -0
- {voly-0.0.222.dist-info → voly-0.0.223.dist-info}/licenses/LICENSE +0 -0
- {voly-0.0.222.dist-info → voly-0.0.223.dist-info}/top_level.txt +0 -0
voly/core/hd.py
CHANGED
@@ -128,6 +128,8 @@ def calculate_historical_returns(df_hist: pd.DataFrame, n_periods: int) -> Tuple
|
|
128
128
|
|
129
129
|
@catch_exception
|
130
130
|
def calculate_normal_hd(df_hist: pd.DataFrame,
|
131
|
+
t: float,
|
132
|
+
r: float,
|
131
133
|
n_periods: int,
|
132
134
|
domains: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]:
|
133
135
|
"""
|
@@ -172,6 +174,8 @@ def calculate_normal_hd(df_hist: pd.DataFrame,
|
|
172
174
|
|
173
175
|
@catch_exception
|
174
176
|
def calculate_student_t_hd(df_hist: pd.DataFrame,
|
177
|
+
t: float,
|
178
|
+
r: float,
|
175
179
|
n_periods: int,
|
176
180
|
domains: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]:
|
177
181
|
"""
|
@@ -233,6 +237,8 @@ def calculate_student_t_hd(df_hist: pd.DataFrame,
|
|
233
237
|
|
234
238
|
@catch_exception
|
235
239
|
def calculate_kde_hd(df_hist: pd.DataFrame,
|
240
|
+
t: float,
|
241
|
+
r: float,
|
236
242
|
n_periods: int,
|
237
243
|
domains: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]:
|
238
244
|
"""
|
@@ -242,6 +248,8 @@ def calculate_kde_hd(df_hist: pd.DataFrame,
|
|
242
248
|
-----------
|
243
249
|
df_hist : pd.DataFrame
|
244
250
|
Historical price data
|
251
|
+
t : float
|
252
|
+
Time to maturity in years
|
245
253
|
n_periods : int
|
246
254
|
Number of periods to scale returns
|
247
255
|
domains : Dict[str, np.ndarray]
|
@@ -258,7 +266,7 @@ def calculate_kde_hd(df_hist: pd.DataFrame,
|
|
258
266
|
|
259
267
|
# Get scaled returns
|
260
268
|
scaled_returns, dte_returns = calculate_historical_returns(df_hist, n_periods)
|
261
|
-
vol = np.sqrt(scaled_returns.std())
|
269
|
+
#vol = np.sqrt(scaled_returns.std())
|
262
270
|
scaled_returns = scaled_returns / vol
|
263
271
|
|
264
272
|
# Fit KDE model using scipy's gaussian_kde with Scott's rule for bandwidth
|
@@ -363,6 +371,7 @@ def get_hd_surface(model_results: pd.DataFrame,
|
|
363
371
|
# Calculate density using the selected method
|
364
372
|
pdfs = calculate_hd(
|
365
373
|
df_hist=df_hist,
|
374
|
+
t = t,
|
366
375
|
n_periods=n_periods,
|
367
376
|
domains=domains
|
368
377
|
)
|
@@ -7,14 +7,14 @@ voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
|
|
7
7
|
voly/core/charts.py,sha256=2S-BfCo30aj1_xlNLqF-za5rQWxF_mWKIdtdOe5bgbw,12735
|
8
8
|
voly/core/data.py,sha256=SNF87C7-r-1IbKwf7rAhXkJ6X305yo7fCDJDdkwz3NM,14103
|
9
9
|
voly/core/fit.py,sha256=bVyx7qMgFFpTUjgoCUs58ppmeNN2CORnqPKbGUpV9xw,14081
|
10
|
-
voly/core/hd.py,sha256=
|
10
|
+
voly/core/hd.py,sha256=1v8jbZZkshGvS8jVWeshSA99JgQ1KpHFXA462ovhtZc,13657
|
11
11
|
voly/core/interpolate.py,sha256=-cNChFpuLnCSMOmfW2ldXxePgQXi-pxcjJvF2yImD1w,5222
|
12
12
|
voly/core/rnd.py,sha256=wiZ5OIjPDf1Th5_sQ9CZG5JgAo3EL8f63T_Rj1_VP-0,13214
|
13
13
|
voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
|
14
14
|
voly/utils/density.py,sha256=ONpRli-IaJDgOZ2sb27HHFc9_tkkGSATKl94JODd86A,5879
|
15
15
|
voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
|
16
|
-
voly-0.0.
|
17
|
-
voly-0.0.
|
18
|
-
voly-0.0.
|
19
|
-
voly-0.0.
|
20
|
-
voly-0.0.
|
16
|
+
voly-0.0.223.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
|
17
|
+
voly-0.0.223.dist-info/METADATA,sha256=5-OCEZktVlR9i7RYwLu10_e9Lp6kDemPY8cd7gRBhwc,4115
|
18
|
+
voly-0.0.223.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
19
|
+
voly-0.0.223.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
|
20
|
+
voly-0.0.223.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|