feat(forecasting): wire validated Almon-ADL into §9.6 consumers (#978) #1049
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1049
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/wire-978-almon-rate-regime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Wires the backtest-validated Almon distributed-lag estimator (#978) into the three §9.6 production consumers, replacing
compute_rate_sensitivity(single best-lag).Why: OOS backtest (PR #1048) showed the current
best_lagengine is directionally noise out-of-sample (0.148 Source B EKB-wide, lag-unstable). The Almon estimator (compute_district_rate_regression) is strictly less noisy on every tier — 0.407 Source B (lag-stable), 0.60 survivorship-free Source A (clears coin-flip+margin).How (minimal-diff, reversible)
regression.compute_rate_regime_sensitivity(db, *, spec, months_back) -> RateSensitivity— mapsDistributedLagFitonto the existingRateSensitivitycontract so the 3 consumers swap only the function name.beta ← coef(long-run Σβ — the correct quantity for a sustained future-rate regime; bounded downstream by the existing[0.5,1.2]clamp).x_pct ← x_pct,y_lag_months ← best_lag_months,phrase ← phrase.confidence: source'regression' → "medium"/'fallback' → "low"(never "high").spec.district is None→ low/beta=None, does not call the regression (it requires a district str).demand_normalization(β discount),product_scoring(x_pct → mortgage_sensitivity),demand_supply_forecast(phrase only, β NOT in arithmetic).compute_rate_sensitivityitself untouched (still used by the backtest + its own tests).normalization_factor/clamp/scoring math untouched.Honest degradation
source='fallback'(gate n≥30 ∧ R²≥0.1 ∧ Σβ<0 not met) → confidence'low'→ demand_normalization goes neutral (norm=1.0, not applied) + product_scoring low. No noisy β applied where there is no signal.Tests
compute_district_rate_regressionwith a realDistributedLagFit; zero vacuous mocks of the now-uncalled function — verified).district=Noneusesassert_not_called().rate_sensitivity.pybyte-identical.Note
This changes prod §9.6 forecast numbers (rate-regime demand discount + mortgage_sensitivity score + explain phrase). Post-deploy spot-check planned on a live segment with a known district.
#979 (seasonal deseasonalization) was validated NEGATIVE in the same backtest → kept advisory, not wired.