feat(forecasting): seasonal demand normalization module (#979) #1039

Merged
bot-backend merged 1 commit from fix/979-seasonal-normalize into main 2026-06-04 06:19:57 +00:00
Collaborator

REOPENED #979 — normalize.py was never created (only rate-regime discount existed).

New backend/app/services/forecasting/normalize.py: normalize_demand(series) does multiplicative month-of-year deseasonalization of the raw monthly demand SalesSeries (§9.4). Pure; min-data guard (factor=1.0 on <2yr/empty-month/overall<=0). Synthetic test: seasonality removed, flat/thin/empty/all-zero safe. 793 forecasting tests green.

DoD (module+doc+test) MET. HONEST CAVEAT: production wiring into rate_sensitivity DEFERRED (documented TODO) — deseasonalizing the short rate-driven series perturbs recovered β/lag on current data; needs points-per-month gate + backtest before wiring. Leaving issue OPEN for that wiring follow-up rather than claiming full done. Refs #979

REOPENED #979 — normalize.py was never created (only rate-regime discount existed). New backend/app/services/forecasting/normalize.py: normalize_demand(series) does multiplicative month-of-year deseasonalization of the raw monthly demand SalesSeries (§9.4). Pure; min-data guard (factor=1.0 on <2yr/empty-month/overall<=0). Synthetic test: seasonality removed, flat/thin/empty/all-zero safe. 793 forecasting tests green. DoD (module+doc+test) MET. HONEST CAVEAT: production wiring into rate_sensitivity DEFERRED (documented TODO) — deseasonalizing the short rate-driven series perturbs recovered β/lag on current data; needs points-per-month gate + backtest before wiring. Leaving issue OPEN for that wiring follow-up rather than claiming full done. Refs #979
bot-backend added 1 commit 2026-06-04 06:19:54 +00:00
feat(forecasting): seasonal (month-of-year) demand normalization (#979)
All checks were successful
Deploy / changes (push) Successful in 6s
Deploy / build-frontend (push) Has been skipped
Deploy / build-worker (push) Successful in 2m16s
Deploy / build-backend (push) Successful in 1m28s
Deploy / deploy (push) Successful in 1m6s
3ecfc2d7dc
REOPENED — normalize.py was never created; only rate-regime discount existed.
New backend/app/services/forecasting/normalize.py with normalize_demand(series):
multiplicative month-of-year deseasonalization of the raw monthly demand
SalesSeries (§9.4). Pure/deterministic; min-data guard (<2 full years / empty
month / overall_mean<=0 → factor 1.0, no divide-by-zero, no thin-data noise).
Exposes seasonal factors for explainability. Synthetic unit test: seasonality
removed (month means equalised), flat unchanged, thin/empty/all-zero safe.

DoD (module + doc + test) MET. Production wiring into
rate_sensitivity._align_sales_deltas DEFERRED (documented TODO): deseasonalizing
the short rate-driven series perturbs the recovered β/lag on current data —
needs a points-per-month gate / joint seasonal+rate estimation + backtest before
wiring. Forecast stack is advisory regardless. Refs #979
bot-backend merged commit 3ecfc2d7dc into main 2026-06-04 06:19:57 +00:00
bot-backend deleted branch fix/979-seasonal-normalize 2026-06-04 06:19:58 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1039
No description provided.