From 9835176e8744dc1edbfad180054b27f5e9296d02 Mon Sep 17 00:00:00 2001 From: Deeman Date: Fri, 27 Feb 2026 07:58:57 +0100 Subject: [PATCH] =?UTF-8?q?fix(sql):=20opportunity=5Fscore=20income=20ceil?= =?UTF-8?q?ing=20/200=E2=86=92/35000=20(economic=20power)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PPS values are 18k–37k but /200 normalisation caused LEAST(1.0, 115)=1.0 for ALL countries — 20pts flat uplift, zero differentiation. Fix: /35000 creates real country spread: LU 20.0pts, DE 15.2pts, ES 12.8pts, GB 10.5pts (vs 20.0 everywhere before) Default for missing data 100→15000 (developing-market assumption, ~0.43). Header comment updated to document v2 formula behaviour. Co-Authored-By: Claude Sonnet 4.6 --- .../serving/location_opportunity_profile.sql | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/transform/sqlmesh_padelnomics/models/serving/location_opportunity_profile.sql b/transform/sqlmesh_padelnomics/models/serving/location_opportunity_profile.sql index 1258c30..b746cab 100644 --- a/transform/sqlmesh_padelnomics/models/serving/location_opportunity_profile.sql +++ b/transform/sqlmesh_padelnomics/models/serving/location_opportunity_profile.sql @@ -8,11 +8,10 @@ -- -- 25 pts addressable market — log-scaled population, ceiling 500K -- (opportunity peaks in mid-size cities; megacities already served) --- 20 pts economic power — country income PPS, normalised to 200 --- NOTE: PPS values are country-level constants in the range --- 18k-37k — ALL EU countries saturate this component (20/20). --- Component is a flat uplift per country until city-level --- income data becomes available. +-- 20 pts economic power — country income PPS, normalised to 35,000 +-- EU PPS values range 18k-37k; /35k gives real spread. +-- DE ≈ 13.2pts, ES ≈ 10.7pts, SE ≈ 14.3pts. +-- Previously /200 caused all countries to saturate at 20/20. -- 30 pts supply gap — INVERTED venue density; 0 courts/100K = full marks. -- Ceiling raised to 8/100K (was 4) for a gentler gradient -- and to account for ~87% data undercount vs FIP totals. @@ -57,9 +56,13 @@ SELECT -- that can support a court but aren't already saturated by large-city operators. 25.0 * LEAST(1.0, LN(GREATEST(l.population, 1)) / LN(500000)) - -- Economic power (20 pts): country-level income PPS normalised to 200. + -- Economic power (20 pts): country-level income PPS normalised to 35,000. -- Drives willingness-to-pay for court fees (€20-35/hr target range). - + 20.0 * LEAST(1.0, COALESCE(l.median_income_pps, 100) / 200.0) + -- EU PPS values range 18k-37k; ceiling 35k gives meaningful spread. + -- v1 used /200 which caused LEAST(1.0, 115) = 1.0 for ALL countries (flat, no differentiation). + -- v2: /35000 → DE 0.66×20=13.2pts, ES 0.53×20=10.7pts, SE 0.71×20=14.3pts. + -- Default 15000 for missing data = reasonable developing-market assumption (~0.43). + + 20.0 * LEAST(1.0, COALESCE(l.median_income_pps, 15000) / 35000.0) -- Supply gap (30 pts): INVERTED venue density. -- 0 courts/100K = full 30 pts (white space); ≥8/100K = 0 pts (served market).