dfm-python 0.5.4__py3-none-any.whl → 0.5.11__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.
Files changed (46) hide show
  1. dfm_python/__init__.py +24 -7
  2. dfm_python/config/__init__.py +4 -2
  3. dfm_python/config/adapter.py +475 -131
  4. dfm_python/config/results.py +7 -58
  5. dfm_python/config/schema.py +452 -517
  6. dfm_python/config/utils.py +9 -21
  7. dfm_python/data/__init__.py +0 -2
  8. dfm_python/data/dataloader.py +3 -3
  9. dfm_python/data/utils.py +3 -2
  10. dfm_python/encoder/vae.py +123 -31
  11. dfm_python/lightning/__init__.py +5 -2
  12. dfm_python/lightning/data_module.py +31 -116
  13. dfm_python/lightning/scaling.py +31 -43
  14. dfm_python/logger/inference_logger.py +1 -1
  15. dfm_python/logger/logger.py +10 -23
  16. dfm_python/logger/train_logger.py +1 -1
  17. dfm_python/models/__init__.py +0 -2
  18. dfm_python/models/base.py +208 -508
  19. dfm_python/models/ddfm.py +1605 -747
  20. dfm_python/models/dfm.py +294 -621
  21. dfm_python/nowcast/__init__.py +37 -0
  22. dfm_python/nowcast/dataview.py +143 -0
  23. dfm_python/nowcast/helpers.py +356 -0
  24. dfm_python/nowcast/nowcast.py +1263 -0
  25. dfm_python/nowcast/splitters.py +441 -0
  26. dfm_python/nowcast/transformers.py +330 -0
  27. dfm_python/nowcast/utils.py +285 -0
  28. dfm_python/ssm/em.py +329 -1139
  29. dfm_python/ssm/kalman.py +183 -692
  30. dfm_python/ssm/utils.py +126 -201
  31. dfm_python/trainer/__init__.py +3 -10
  32. dfm_python/trainer/ddfm.py +4 -5
  33. dfm_python/trainer/dfm.py +3 -3
  34. dfm_python/utils/__init__.py +32 -9
  35. dfm_python/utils/data.py +3 -68
  36. dfm_python/utils/helpers.py +1 -1
  37. dfm_python/utils/statespace.py +7 -10
  38. dfm_python/utils/time.py +3 -3
  39. dfm_python-0.5.11.dist-info/METADATA +1299 -0
  40. dfm_python-0.5.11.dist-info/RECORD +49 -0
  41. dfm_python/models/mcmc.py +0 -498
  42. dfm_python/models/utils.py +0 -470
  43. dfm_python-0.5.4.dist-info/METADATA +0 -510
  44. dfm_python-0.5.4.dist-info/RECORD +0 -44
  45. {dfm_python-0.5.4.dist-info → dfm_python-0.5.11.dist-info}/WHEEL +0 -0
  46. {dfm_python-0.5.4.dist-info → dfm_python-0.5.11.dist-info}/licenses/LICENSE +0 -0
dfm_python/__init__.py CHANGED
@@ -6,6 +6,7 @@ This package implements a comprehensive Dynamic Factor Model framework with supp
6
6
  - Tent kernel aggregation for low-to-high frequency mapping
7
7
  - Expectation-Maximization (EM) algorithm for parameter estimation
8
8
  - Kalman filtering and smoothing for factor extraction
9
+ - News decomposition for nowcasting
9
10
  - Deep Dynamic Factor Models (DDFM) with nonlinear encoders (requires PyTorch)
10
11
 
11
12
  The package implements a clock-based approach to mixed-frequency DFMs, where all latent
@@ -22,6 +23,7 @@ Key Features:
22
23
  - Flexible block structure for factor modeling
23
24
  - Robust handling of missing data (internal spline interpolation)
24
25
  - Automatic standardization and data clipping
26
+ - News decomposition for forecast updates
25
27
 
26
28
  Example (Standard Lightning Pattern):
27
29
  >>> from dfm_python import DFM, DFMDataModule, DFMTrainer
@@ -65,7 +67,7 @@ Note: DFMConfig and SeriesConfig are internal implementation details.
65
67
  For detailed documentation, see the README.md file and the tutorial notebooks/scripts.
66
68
  """
67
69
 
68
- __version__ = "0.5.4"
70
+ __version__ = "0.5.11"
69
71
 
70
72
  # ============================================================================
71
73
  # PUBLIC API DEFINITION
@@ -79,14 +81,15 @@ __version__ = "0.5.4"
79
81
  # 2. High-level API: DFM, DDFM, module-level convenience functions
80
82
  # 3. Core utilities: TimeIndex, diagnostics
81
83
  # 4. Models: BaseFactorModel, DDFM (low-level)
82
- # 5. Data & Results: DFMResult
84
+ # 5. Nowcasting: Nowcast, result classes, para_const
85
+ # 6. Data & Results: DFMResult
83
86
  # ============================================================================
84
87
 
85
88
  # Configuration (from config/ subpackage)
86
89
  from .config import (
87
90
  DEFAULT_BLOCK_NAME,
88
- ConfigSource, YamlSource, HydraSource,
89
- make_config_source,
91
+ ConfigSource, YamlSource, DictSource, HydraSource,
92
+ MergedConfigSource, make_config_source,
90
93
  )
91
94
  # Internal imports (for backward compatibility, but not recommended)
92
95
  from .config import DFMConfig, SeriesConfig # Internal use only
@@ -107,6 +110,17 @@ from .lightning import (
107
110
  EMAlgorithm, # Module class
108
111
  )
109
112
 
113
+ # Nowcasting (from nowcast/ subpackage)
114
+ from .nowcast import (
115
+ Nowcast,
116
+ NowcastResult,
117
+ )
118
+ from .nowcast.helpers import (
119
+ para_const,
120
+ NewsDecompResult,
121
+ BacktestResult,
122
+ )
123
+
110
124
  # Model implementations
111
125
  from .models.base import BaseFactorModel
112
126
  from .models.dfm import DFM
@@ -116,16 +130,19 @@ from .models.ddfm import DDFM, DDFMModel
116
130
 
117
131
  __all__ = [
118
132
  # Core classes
119
- 'DFM',
133
+ 'DFM', 'Nowcast',
120
134
  # Model base and implementations
121
135
  'BaseFactorModel',
136
+ # Nowcast result classes
137
+ 'NowcastResult', 'NewsDecompResult', 'BacktestResult',
122
138
  # Constants
123
139
  'DEFAULT_BLOCK_NAME',
124
140
  # Config sources
125
- 'ConfigSource', 'YamlSource', 'HydraSource',
126
- 'make_config_source',
141
+ 'ConfigSource', 'YamlSource', 'DictSource', 'HydraSource',
142
+ 'MergedConfigSource', 'make_config_source',
127
143
  # Low-level API (functional interface - advanced usage)
128
144
  'BaseResult', 'DFMResult', 'DDFMResult', 'calculate_rmse', 'diagnose_series', 'print_series_diagnosis',
145
+ 'para_const', # Internal utility for nowcasting
129
146
  ]
130
147
 
131
148
  # DDFM high-level API (PyTorch is mandatory)
@@ -14,7 +14,9 @@ from .utils import validate_frequency, validate_transformation
14
14
  from .adapter import (
15
15
  ConfigSource,
16
16
  YamlSource,
17
+ DictSource,
17
18
  HydraSource,
19
+ MergedConfigSource,
18
20
  make_config_source,
19
21
  )
20
22
  from .utils import (
@@ -41,8 +43,8 @@ __all__ = [
41
43
  # Utilities
42
44
  'validate_frequency', 'validate_transformation',
43
45
  # IO
44
- 'ConfigSource', 'YamlSource',
45
- 'HydraSource', 'make_config_source',
46
+ 'ConfigSource', 'YamlSource', 'DictSource',
47
+ 'HydraSource', 'MergedConfigSource', 'make_config_source',
46
48
  # Frequency and aggregation utilities
47
49
  'FREQUENCY_HIERARCHY',
48
50
  'PERIODS_PER_YEAR',