How animeshav14/pmg-econ works
PMG Macro Regime Engine retrieves and prepares macroeconomic and market observations, builds four distinct feature pillars, classifies pillar and composite regimes, and studies sector behavior within those regimes. Its principal workflow runs through run_engine.py into src/engine.py; separate expanding-window and archived-vintage diagnostics extend that analysis. The README documents outputs for current state, pillar diagnostics, composite maps, sector statistics, and backtests. Relationships reflect shown calls and documented capabilities; some output and retrieval links rely on README statements or SOURCE INDEX references rather than complete source excerpts.
Main entry points: engine.py Analysis orchestrator · transforms.py Monthly preparation · vintages.py Vintage backtest · update_data.py Data updater
Components 21
Data acquisition
- Data updater
update_data.py - Data sources
src/registry.py - Raw snapshots
data/raw
Feature preparation
- Monthly preparation
src/transforms.py - Growth features
pillar_1/features.py - Financial features
pillar_2/features.py - Inflation features
pillar_3/features.py - Market features
pillar_4/features.py
Regime analysis
- Analysis orchestrator
src/engine.py - Pillar regime models
src/model.py - Composite regime
src/model.py - Sector statistics
src/sectors.py
Historical diagnostics
- Expanding backtest
src/engine.py - Vintage command
backtest_vintages.py - Vintage backtest
src/vintages.py
Reporting
- Maps and charts
src/plots.py - Analysis outputs
outputs
Other components
- Analyst
- Run interface
run_engine.py - FRED / ALFRED
- Yahoo Finance
Connections 28
- Analyst → Run interface: runs
run_engine.py - Run interface → Analysis orchestrator: invokes
run_engine.py - Analyst → Data updater: requests updates
README.md - Data updater → Data sources: uses series
- Data updater → FRED / ALFRED: downloads
- Data updater → Yahoo Finance: downloads
- Data updater → Raw snapshots: saves snapshots
README.md - Analysis orchestrator → Monthly preparation: prepares panels
src/engine.py - Monthly preparation → Raw snapshots: loads cached data
src/transforms.py - Monthly preparation → Data sources: uses metadata
src/transforms.py - Monthly preparation → Growth features: builds features
src/transforms.py - Monthly preparation → Financial features: builds features
src/transforms.py - Monthly preparation → Inflation features: builds features
src/transforms.py - Monthly preparation → Market features: builds features
src/transforms.py - Analysis orchestrator → Pillar regime models: fits pillar models
src/engine.py - Analysis orchestrator → Composite regime: combines pillars
src/engine.py - Analysis orchestrator → Sector statistics: computes associations
src/engine.py - Analysis orchestrator → Maps and charts: renders figures
src/engine.py - Analysis orchestrator → Analysis outputs: writes results
README.md - Analysis orchestrator → Expanding backtest: runs diagnostics
run_engine.py - Expanding backtest → Pillar regime models: refits models
src/engine.py - Expanding backtest → Sector statistics: summarizes returns
src/engine.py - Vintage command → Vintage backtest: invokes
backtest_vintages.py - Vintage backtest → FRED / ALFRED: fetches vintages
src/vintages.py - Vintage backtest → Monthly preparation: prepares vintage panels
src/vintages.py - Vintage backtest → Analysis orchestrator: uses one-step fit
src/vintages.py - Vintage backtest → Sector statistics: analyzes forward returns
src/vintages.py - Vintage backtest → Analysis outputs: writes vintage results
README.md