Add rate_sensitivity.py: regress Δln(sales) on lagged Δ(key_rate) per segment, gate (n≥8, r2≥0.1, slope<0), shrink toward EKB-wide prior (w=n/(n+10); EKB prior bootstrapped from all-None spec, gate-fail→0.0 neutral), emit §9.6 explainability phrase (X=100·(exp(β)−1), Y=lag, Z=most-sensitive Source-B bucket area floor). Pure numpy helpers (ols_slope_r2, best_lag, shrink) DB-free + unit-tested on synthetic series (real slope/lag recovery); compute_rate_sensitivity tested with mocked PR1/PR2. Wrong-sign guarded 3 layers; degrades to insufficient-data / EKB-wide form on thin/wrong-sign. ADVISORY until PR6 backtest — not wired into any endpoint. 28 tests (forecasting/ total 141), ruff clean. Follow-ups for PR6 backtest: validate lag selection out-of-sample (spurious-lag on short windows), confirm _SHRINK_K + confidence thresholds before prod wiring. |
||
|---|---|---|
| .. | ||
| cadastre | ||
| etl | ||
| exporters | ||
| forecasting | ||
| generative | ||
| photos | ||
| scrapers | ||
| site_finder | ||
| __init__.py | ||
| analytics_queries.py | ||
| analytics_refresh.py | ||
| job_settings.py | ||
| objective_etl.py | ||
| objective_sync_config.py | ||