dfm-python 0.2.7__tar.gz → 0.2.8__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 (39) hide show
  1. {dfm_python-0.2.7 → dfm_python-0.2.8}/.gitignore +3 -1
  2. {dfm_python-0.2.7 → dfm_python-0.2.8}/PKG-INFO +1 -1
  3. dfm_python-0.2.8/config/blocks/default.yaml +63 -0
  4. dfm_python-0.2.8/full_tutorial_example.ipynb +2014 -0
  5. {dfm_python-0.2.7 → dfm_python-0.2.8}/pyproject.toml +1 -1
  6. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/__init__.py +1 -1
  7. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/core/diagnostics.py +215 -6
  8. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/core/em.py +49 -49
  9. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/core/numeric.py +7 -7
  10. {dfm_python-0.2.7 → dfm_python-0.2.8}/tutorial/basic_tutorial.py +140 -1
  11. {dfm_python-0.2.7 → dfm_python-0.2.8}/uv.lock +699 -10
  12. dfm_python-0.2.7/config/blocks/default.yaml +0 -48
  13. dfm_python-0.2.7/full_tutorial_example.ipynb +0 -1669
  14. {dfm_python-0.2.7 → dfm_python-0.2.8}/.python-version +0 -0
  15. {dfm_python-0.2.7 → dfm_python-0.2.8}/LICENSE +0 -0
  16. {dfm_python-0.2.7 → dfm_python-0.2.8}/MANIFEST.in +0 -0
  17. {dfm_python-0.2.7 → dfm_python-0.2.8}/README.md +0 -0
  18. {dfm_python-0.2.7 → dfm_python-0.2.8}/config/default.yaml +0 -0
  19. {dfm_python-0.2.7 → dfm_python-0.2.8}/config/series/default.yaml +0 -0
  20. {dfm_python-0.2.7 → dfm_python-0.2.8}/data/sample_data.csv +0 -0
  21. {dfm_python-0.2.7 → dfm_python-0.2.8}/data/sample_spec.csv +0 -0
  22. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/api.py +0 -0
  23. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/config.py +0 -0
  24. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/config_sources.py +0 -0
  25. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/core/__init__.py +0 -0
  26. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/core/helpers.py +0 -0
  27. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/data.py +0 -0
  28. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/dfm.py +0 -0
  29. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/kalman.py +0 -0
  30. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/news.py +0 -0
  31. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/dfm_python/utils.py +0 -0
  32. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/__init__.py +0 -0
  33. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/test_api.py +0 -0
  34. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/test_dfm.py +0 -0
  35. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/test_factor.py +0 -0
  36. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/test_kalman.py +0 -0
  37. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/test_numeric.py +0 -0
  38. {dfm_python-0.2.7 → dfm_python-0.2.8}/src/test/test_stability.py +0 -0
  39. {dfm_python-0.2.7 → dfm_python-0.2.8}/tutorial/hydra_tutorial.py +0 -0
@@ -212,4 +212,6 @@ __marimo__/
212
212
  *.sh
213
213
 
214
214
  Nowcasting/
215
- agent/
215
+ agent/
216
+
217
+ mybooks/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dfm-python
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Dynamic Factor Model (DFM) estimation and nowcasting in Python
5
5
  Project-URL: Homepage, https://github.com/yourusername/dfm-python
6
6
  Project-URL: Documentation, https://github.com/yourusername/dfm-python#readme
@@ -0,0 +1,63 @@
1
+ # ============================================================================
2
+ # DFM Block Structure Configuration
3
+ # ============================================================================
4
+ # Each block corresponds to a set of series defined in config/series/default.yaml
5
+ # and represents one latent factor (or more) capturing that sector's dynamics.
6
+ #
7
+ # Each block has:
8
+ # - factors: number of latent factors in this block
9
+ # **IMPORTANT**: This should be determined based on:
10
+ # * Number of series in the block (more series may need more factors)
11
+ # * Complexity of the sector (simple sectors: 1, complex: 2-3)
12
+ # * Model fit diagnostics (check factor loadings and explained variance)
13
+ # * Typical range: 1-3 factors per block
14
+ # * Start with 1 and increase if model fit is poor
15
+ # - ar_lag: autoregressive lag order for the block-level factor (typically 1)
16
+ # - clock: optional, if block frequency differs from global clock
17
+ # - notes: optional comments
18
+ #
19
+ # **How to determine factors per block:**
20
+ # 1. Start with factors: 1 for each block (simplest model)
21
+ # 2. Check model diagnostics: factor loadings, explained variance per series
22
+ # 3. If many series in a block have low loadings (<0.3), consider increasing factors
23
+ # 4. Use cross-validation or information criteria (AIC/BIC) to compare models
24
+ # 5. Consider economic theory: does the sector have multiple distinct drivers?
25
+ #
26
+ # **Current settings are examples - adjust based on your data and modeling goals!**
27
+ # ============================================================================
28
+
29
+ Block_Global:
30
+ factors: 3 # Adjust based on data complexity and model diagnostics
31
+ ar_lag: 1
32
+ clock: m
33
+ notes: "Global (aggregate) factor driving all blocks"
34
+
35
+ Block_Consumption:
36
+ factors: 1 # Adjust based on data complexity and model diagnostics
37
+ ar_lag: 1
38
+ clock: m
39
+ notes: "Consumption-related indicators (retail sales, CSI, etc.)"
40
+
41
+ Block_Investment:
42
+ factors: 1 # Adjust based on data complexity and model diagnostics
43
+ ar_lag: 1
44
+ clock: m
45
+ notes: "Investment-related indicators (GFCF, BSI Investment, etc.)"
46
+
47
+ Block_Export:
48
+ factors: 1 # Adjust based on data complexity and model diagnostics
49
+ ar_lag: 1
50
+ clock: m
51
+ notes: "Export and external demand (goods & services, terms of trade, etc.)"
52
+
53
+ Block_Labor:
54
+ factors: 1 # Adjust based on data complexity and model diagnostics
55
+ ar_lag: 1
56
+ clock: m
57
+ notes: "Employment, unemployment, participation, labor expectations"
58
+
59
+ Block_Nominal:
60
+ factors: 1 # Adjust based on data complexity and model diagnostics
61
+ ar_lag: 1
62
+ clock: m
63
+ notes: "Nominal price-level or value indicators (PPI, CPI, trade prices, credit, etc.)"