From 6a9d0ac43d3eb2863915842cdf22bebef74b1588 Mon Sep 17 00:00:00 2001 From: Vahid Ahmadi Date: Wed, 29 Jul 2026 17:51:59 +0200 Subject: [PATCH] make_hero.py: compute widest band per-quarter and describe lower edge from data The desc previously labeled the widest quarter by min lower edge and spliced min(lo90)/max(hi90) from different quarters; it also asserted the lower edge stays below zero regardless of the data. Co-Authored-By: Claude Fable 5 --- assets/make_hero.py | 18 ++++++++++++++---- index.html | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/assets/make_hero.py b/assets/make_hero.py index 3c6b7bb..f3ab212 100644 --- a/assets/make_hero.py +++ b/assets/make_hero.py @@ -77,14 +77,24 @@ def band(lo, hi): ) return f"M{up} L{dn} Z" + widths = [hi - lo for lo, hi in zip(lo90, hi90)] + w = widths.index(max(widths)) + neg = [i for i, lo in enumerate(lo90) if lo < 0] + if not neg: + edge = "its lower edge stays positive throughout the forecast" + elif neg[0] == 0: + edge = "its lower edge is below zero throughout the forecast" + else: + edge = ( + f"its lower edge is positive for the first " + f"{'quarter' if neg[0] == 1 else str(neg[0]) + ' quarters'} and dips " + f"below zero from {quarters[neg[0]]} onward" + ) desc = ( f"Fan chart. Posterior forecast of UK year-on-year real GDP growth from the " f"boe-svar model, {quarters[0]} to {quarters[-1]}, conditioned through 2026Q1. The " f"median path runs from {med[0]:+.2f}% to {med[-1]:+.2f}%. The 90% credible band " - f"is widest at {quarters[lo90.index(min(lo90))]}, spanning {min(lo90):+.2f}% to " - f"{max(hi90):+.2f}%, and the lower edge stays below zero throughout the forecast: " - f"the model does not rule out a contraction. This figure is the site's hero motif " - f"and uses the site's current-forecast artifact rather than the frozen validation run." + f"is widest at {quarters[w]}, spanning {lo90[w]:+.2f}% to {hi90[w]:+.2f}%; {edge}." ) out = [ diff --git a/index.html b/index.html index bb5cced..2259ea7 100644 --- a/index.html +++ b/index.html @@ -61,7 +61,7 @@

boe-svar: UK real GDP growth forecast, median with 68% and 90% credible bands -Fan chart. Posterior forecast of UK year-on-year real GDP growth from the boe-svar model, 2026Q2 to 2029Q2, conditioned through 2026Q1. The median path runs from +1.14% to +1.41%. The 90% credible band is widest at 2029Q2, spanning -0.67% to +3.77%; its lower edge is positive for the first three quarters and dips below zero from 2027Q1 onward: the model does not rule out a contraction. +Fan chart. Posterior forecast of UK year-on-year real GDP growth from the boe-svar model, 2026Q2 to 2029Q2, conditioned through 2026Q1. The median path runs from +1.14% to +1.41%. The 90% credible band is widest at 2029Q2, spanning -0.67% to +3.77%; its lower edge is positive for the first 3 quarters and dips below zero from 2027Q1 onward. -1%