tempdisagg 0.2.6__tar.gz → 0.2.7__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.
- {tempdisagg-0.2.6/tempdisagg.egg-info → tempdisagg-0.2.7}/PKG-INFO +1 -1
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/pyproject.toml +1 -1
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/__init__.py +1 -7
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/models_handler.py +1 -44
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_core.py +0 -1
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_fitter.py +0 -1
- {tempdisagg-0.2.6 → tempdisagg-0.2.7/tempdisagg.egg-info}/PKG-INFO +1 -1
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/LICENSE +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/README.md +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/setup.cfg +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/core/__init__.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/core/numeric_utils.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/core/rho_optimizer.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/core/temporal_aggregator.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/__init__.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_adjuster.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_base.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_ensemble.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_model.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_summary.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/model/tempdisagg_visualizer.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/postprocessing/__init__.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/postprocessing/ensemble_prediction.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/postprocessing/post_estimation.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/preprocessing/__init__.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/preprocessing/conversion_matrix_builder.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/preprocessing/disagg_input_preparer.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/preprocessing/input_preprocessor.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/preprocessing/timeseries_completer.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/utils/__init__.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/utils/logging_utils.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg/utils/retropolarizer.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg.egg-info/SOURCES.txt +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg.egg-info/dependency_links.txt +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg.egg-info/requires.txt +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tempdisagg.egg-info/top_level.txt +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tests/test_numeric_utils.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tests/test_prediction.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tests/test_rho_optimizer.py +0 -0
- {tempdisagg-0.2.6 → tempdisagg-0.2.7}/tests/test_summary_visualize.py +0 -0
|
@@ -28,10 +28,4 @@ __all__ = [
|
|
|
28
28
|
"TimeSeriesCompleter",
|
|
29
29
|
]
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
from importlib.metadata import version, PackageNotFoundError
|
|
33
|
-
|
|
34
|
-
try:
|
|
35
|
-
__version__ = version("tempdisagg")
|
|
36
|
-
except PackageNotFoundError:
|
|
37
|
-
__version__ = "unknown"
|
|
31
|
+
__version__ = "0.2.7"
|
|
@@ -360,50 +360,7 @@ class ModelsHandler:
|
|
|
360
360
|
|
|
361
361
|
except Exception as e:
|
|
362
362
|
self.logger.error(f"Optimized Litterman failed: {e}")
|
|
363
|
-
return None
|
|
364
|
-
|
|
365
|
-
def denton_opt_estimation(self, y_l, X, C, h_values=[1, 2, 3, 4]):
|
|
366
|
-
"""
|
|
367
|
-
Run Denton method over multiple differencing orders and select the best based on minimum RSS.
|
|
368
|
-
|
|
369
|
-
Parameters
|
|
370
|
-
----------
|
|
371
|
-
y_l : np.ndarray
|
|
372
|
-
Low-frequency target series.
|
|
373
|
-
X : np.ndarray
|
|
374
|
-
High-frequency regressor series.
|
|
375
|
-
C : np.ndarray
|
|
376
|
-
Conversion matrix from high to low frequency.
|
|
377
|
-
h_values : list, default=[1, 2, 3]
|
|
378
|
-
List of differencing orders to evaluate.
|
|
379
|
-
|
|
380
|
-
Returns
|
|
381
|
-
-------
|
|
382
|
-
dict or None
|
|
383
|
-
Best estimation result dictionary with keys 'y_hat', 'beta', 'residuals', 'Q', 'vcov', and selected 'h'.
|
|
384
|
-
Returns None if all estimations fail.
|
|
385
|
-
"""
|
|
386
|
-
best_result = None
|
|
387
|
-
min_rss = np.inf
|
|
388
|
-
|
|
389
|
-
for h in h_values:
|
|
390
|
-
result = self.denton_estimation(y_l, X, C, h=h)
|
|
391
|
-
if result is not None:
|
|
392
|
-
rss = float((result["residuals"].T @ result["residuals"]).item())
|
|
393
|
-
if rss < min_rss:
|
|
394
|
-
min_rss = rss
|
|
395
|
-
best_result = result
|
|
396
|
-
best_result["h"] = h
|
|
397
|
-
|
|
398
|
-
if best_result is None:
|
|
399
|
-
self.logger.error("All Denton estimations failed.")
|
|
400
|
-
return None
|
|
401
|
-
|
|
402
|
-
if self.verbose:
|
|
403
|
-
self.logger.info(f"Best Denton estimation selected with h = {best_result['h']} (RSS = {min_rss:.4f})")
|
|
404
|
-
|
|
405
|
-
return best_result
|
|
406
|
-
|
|
363
|
+
return None
|
|
407
364
|
|
|
408
365
|
def denton_cholette_estimation(self,y_l, X, C, base_series=None, weights=None):
|
|
409
366
|
"""
|
|
@@ -130,7 +130,6 @@ class TempDisaggModelCore:
|
|
|
130
130
|
"litterman-opt": self.models.litterman_opt_estimation,
|
|
131
131
|
"chow-lin-ecotrim": self.models.chow_lin_minrss_ecotrim,
|
|
132
132
|
"chow-lin-quilis": self.models.chow_lin_minrss_quilis,
|
|
133
|
-
"denton-opt": self.models.denton_opt_estimation,
|
|
134
133
|
"denton-colette": self.models.denton_cholette_estimation,
|
|
135
134
|
"uniform": self.models.uniform_estimation
|
|
136
135
|
}
|
|
@@ -110,7 +110,6 @@ class ModelFitter:
|
|
|
110
110
|
"litterman-opt": self.models.litterman_opt_estimation,
|
|
111
111
|
"chow-lin-ecotrim": self.models.chow_lin_minrss_ecotrim,
|
|
112
112
|
"chow-lin-quilis": self.models.chow_lin_minrss_quilis,
|
|
113
|
-
"denton-opt": self.models.denton_opt_estimation,
|
|
114
113
|
"denton-colette": self.models.denton_cholette_estimation,
|
|
115
114
|
"uniform": self.models.uniform_estimation,
|
|
116
115
|
}
|
|
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
|
|
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
|