Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions assets/make_hero.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h1 class="reveal" style="--d:1">
<!-- hero-fan:begin -->
<svg class="hero-fan" viewBox="0 0 640 400" preserveAspectRatio="xMidYMid meet" role="img" aria-labelledby="hero-fan-t hero-fan-d">
<title id="hero-fan-t">boe-svar: UK real GDP growth forecast, median with 68% and 90% credible bands</title>
<desc id="hero-fan-d">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.</desc>
<desc id="hero-fan-d">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.</desc>
<line class="hf-grid" x1="30.0" y1="302.3" x2="604.0" y2="302.3"/>
<text class="hf-tick" x="30.0" y="295.3">-1%</text>
<line class="hf-zero" x1="30.0" y1="242.7" x2="604.0" y2="242.7"/>
Expand Down