← story.propek
STORY MI-3.2
MI-3.2
Epic: Market Intel Macro v1
PENDING
ACCEPTANCE CRITERIA (9/9)
1. Script `scripts/correlation-check.js` reads all timeseries files (bcb-indicators.json, commodities.json, fred-indicators.json)
2. Implements Pearson correlation coefficient calculation without external dependencies
3. Requires minimum 12 data points per pair -- below that, reports "dados insuficientes" without error
4. Analyzes 5 predefined indicator pairs: (petroleo_wti, usd_brl), (selic, usd_brl), (petroleo_brent, ipca), (usd_brl, ipca), (fed_funds_rate, usd_brl)
5. For each pair, tests correlation at lags: 0, 1, 2, 4, 8, 12 weeks. Reports the lag with highest |r|
6. Classifies correlation strength: strong (|r| > 0.7), moderate (0.4-0.7), weak (< 0.4)
7. Output `data/state/correlation-history.json` with calculated_at, data_points_available, correlations array, insufficient_data array
8. Supports `--dry-run`, `--verbose`, `--help`, `--lag {weeks}` flags
9. No API key or external data needed -- works entirely on local timeseries files