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
30 changes: 28 additions & 2 deletions economy/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,32 @@ def stored(value: float) -> str:
return f"{value:,}"


def display(series: dict, value: float) -> str:
"""The reading a person would say out loud.

stored() is right for the method note and for anything asserting fidelity
to the snapshot, but it is wrong for the number a reader meets first: the
restructure made the public-finances headline read "-15,989.0" where the
page it replaced said "£16.0bn borrowed", and dropped "£77.1bn" and
"£749/week" from the site entirely. Scale and unit here; exact stored
value stays one line below and in the method note.
"""
units = series["units"].lower()
if "£m" in units or "\u00a3m" in units:
billions = abs(value) / 1000
borrowed = " borrowed" if value < 0 and "borrowing" in series["title"].lower() else ""
return f"\u00a3{billions:,.1f}bn{borrowed}"
if "per week" in units:
return f"\u00a3{value:,.0f}/week"
if "thousand" in units:
return f"{value:,.0f}k"
if "percent" in units or units.startswith("%"):
# Keep the publisher's precision: a stored 5.0 is 5.0%, not 5%. The
# trailing zero is information about how the figure was published.
return f"{stored(value)}%"
return stored(value)


def listed(items: list[str]) -> str:
"""Join a registry list the way a sentence needs it."""
if len(items) < 2:
Expand Down Expand Up @@ -265,8 +291,8 @@ def stat_card(series: dict) -> str:
now = latest(series)
return f""" <article class="economy-stat">
<p class="economy-stat-label mono">{esc(label(series).upper())}</p>
<p class="economy-stat-value">{esc(stored(now["value"]))}{suffix(series)}</p>
<p class="economy-stat-change">{esc(series["units"])}</p>
<p class="economy-stat-value">{esc(display(series, now["value"]))}</p>
<p class="economy-stat-change">stored as {esc(stored(now["value"]))} &middot; {esc(series["units"])}</p>
<dl>
<div><dt>Observation</dt><dd>{esc(now["period"])}</dd></div>
<div><dt>Vintage</dt><dd>{esc(series["vintage"])}</dd></div>
Expand Down
10 changes: 5 additions & 5 deletions economy/topics/growth/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ <h2>The numbers, as the snapshot stores them.</h2>
<div class="economy-grid">
<article class="economy-stat">
<p class="economy-stat-label mono">REAL GROSS DOMESTIC PRODUCT</p>
<p class="economy-stat-value">709,598.0</p>
<p class="economy-stat-change">£m, chained volume measure</p>
<p class="economy-stat-value">£709.6bn</p>
<p class="economy-stat-change">stored as 709,598.0 &middot; £m, chained volume measure</p>
<dl>
<div><dt>Observation</dt><dd>2026Q1</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand All @@ -91,7 +91,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">MONTHLY GROSS VALUE ADDED INDEX</p>
<p class="economy-stat-value">103.2</p>
<p class="economy-stat-change">index, chained volume measure, seasonally adjusted</p>
<p class="economy-stat-change">stored as 103.2 &middot; index, chained volume measure, seasonally adjusted</p>
<dl>
<div><dt>Observation</dt><dd>2026-05</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand All @@ -100,8 +100,8 @@ <h2>The numbers, as the snapshot stores them.</h2>
</article>
<article class="economy-stat">
<p class="economy-stat-label mono">REAL BUSINESS INVESTMENT</p>
<p class="economy-stat-value">77,134.0</p>
<p class="economy-stat-change">£m, chained volume measure, seasonally adjusted</p>
<p class="economy-stat-value">£77.1bn</p>
<p class="economy-stat-change">stored as 77,134.0 &middot; £m, chained volume measure, seasonally adjusted</p>
<dl>
<div><dt>Observation</dt><dd>2026Q1</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/inflation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">CPI INFLATION</p>
<p class="economy-stat-value">2.8%</p>
<p class="economy-stat-change">percent, year-on-year</p>
<p class="economy-stat-change">stored as 2.8 &middot; percent, year-on-year</p>
<dl>
<div><dt>Observation</dt><dd>2026Q2</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand All @@ -91,7 +91,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">CORE CPI INFLATION</p>
<p class="economy-stat-value">2.6%</p>
<p class="economy-stat-change">percent, year-on-year</p>
<p class="economy-stat-change">stored as 2.6 &middot; percent, year-on-year</p>
<dl>
<div><dt>Observation</dt><dd>2026-06</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand Down
10 changes: 5 additions & 5 deletions economy/topics/jobs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">UNEMPLOYMENT RATE</p>
<p class="economy-stat-value">5.0%</p>
<p class="economy-stat-change">percent</p>
<p class="economy-stat-change">stored as 5.0 &middot; percent</p>
<dl>
<div><dt>Observation</dt><dd>2026Q1</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand All @@ -90,8 +90,8 @@ <h2>The numbers, as the snapshot stores them.</h2>
</article>
<article class="economy-stat">
<p class="economy-stat-label mono">UK VACANCIES</p>
<p class="economy-stat-value">712.0</p>
<p class="economy-stat-change">thousands, seasonally adjusted three-month average</p>
<p class="economy-stat-value">712k</p>
<p class="economy-stat-change">stored as 712.0 &middot; thousands, seasonally adjusted three-month average</p>
<dl>
<div><dt>Observation</dt><dd>2026-05</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand All @@ -100,8 +100,8 @@ <h2>The numbers, as the snapshot stores them.</h2>
</article>
<article class="economy-stat">
<p class="economy-stat-label mono">AVERAGE WEEKLY EARNINGS</p>
<p class="economy-stat-value">749.0</p>
<p class="economy-stat-change">£ per week, seasonally adjusted</p>
<p class="economy-stat-value">£749/week</p>
<p class="economy-stat-change">stored as 749.0 &middot; £ per week, seasonally adjusted</p>
<dl>
<div><dt>Observation</dt><dd>2026-05</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand Down
6 changes: 3 additions & 3 deletions economy/topics/public-finances/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ <h2>The numbers, as the snapshot stores them.</h2>
<div class="economy-grid">
<article class="economy-stat">
<p class="economy-stat-label mono">PUBLIC-SECTOR NET BORROWING</p>
<p class="economy-stat-value">-15,989.0</p>
<p class="economy-stat-change">£m, current prices, not seasonally adjusted</p>
<p class="economy-stat-value">£16.0bn borrowed</p>
<p class="economy-stat-change">stored as -15,989.0 &middot; £m, current prices, not seasonally adjusted</p>
<dl>
<div><dt>Observation</dt><dd>2026-06</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand All @@ -91,7 +91,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">PUBLIC-SECTOR NET DEBT</p>
<p class="economy-stat-value">94.9%</p>
<p class="economy-stat-change">percent of GDP, not seasonally adjusted</p>
<p class="economy-stat-change">stored as 94.9 &middot; percent of GDP, not seasonally adjusted</p>
<dl>
<div><dt>Observation</dt><dd>2026-06</dd></div>
<div><dt>Vintage</dt><dd>2026-07-26</dd></div>
Expand Down
8 changes: 4 additions & 4 deletions economy/topics/rates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">OFFICIAL BANK RATE</p>
<p class="economy-stat-value">3.75%</p>
<p class="economy-stat-change">percent</p>
<p class="economy-stat-change">stored as 3.75 &middot; percent</p>
<dl>
<div><dt>Observation</dt><dd>2026-08-10</dd></div>
<div><dt>Vintage</dt><dd>2026-08-12</dd></div>
Expand All @@ -91,7 +91,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">UK NOMINAL PAR YIELD, 5 YEAR</p>
<p class="economy-stat-value">4.4356%</p>
<p class="economy-stat-change">percent</p>
<p class="economy-stat-change">stored as 4.4356 &middot; percent</p>
<dl>
<div><dt>Observation</dt><dd>2026-08-07</dd></div>
<div><dt>Vintage</dt><dd>2026-08-12</dd></div>
Expand All @@ -101,7 +101,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">UK NOMINAL PAR YIELD, 10 YEAR</p>
<p class="economy-stat-value">4.9118%</p>
<p class="economy-stat-change">percent</p>
<p class="economy-stat-change">stored as 4.9118 &middot; percent</p>
<dl>
<div><dt>Observation</dt><dd>2026-08-07</dd></div>
<div><dt>Vintage</dt><dd>2026-08-12</dd></div>
Expand All @@ -111,7 +111,7 @@ <h2>The numbers, as the snapshot stores them.</h2>
<article class="economy-stat">
<p class="economy-stat-label mono">UK NOMINAL PAR YIELD, 20 YEAR</p>
<p class="economy-stat-value">5.4311%</p>
<p class="economy-stat-change">percent</p>
<p class="economy-stat-change">stored as 5.4311 &middot; percent</p>
<dl>
<div><dt>Observation</dt><dd>2026-08-07</dd></div>
<div><dt>Vintage</dt><dd>2026-08-12</dd></div>
Expand Down
2 changes: 1 addition & 1 deletion obr/validation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h2>Excellent anchored. Weak free-running. Both published.</h2>
<tr>
<th scope="row"><strong>Held add-factors</strong></th>
<td>Add-factors fitted 2024Q1–2025Q4, held flat, projected to 2027Q4. Scored over 2026Q1–2027Q4 on the March 2026 baseline (caveats in the notes below).</td>
<td>GDP 0.37%, consumption 0.33%; 6 of 8 computed variables within band. (The working paper's November-2025-vintage scorecard, over its own longer window, reports GDP 2.2% and consumption 3.6%.)</td>
<td>GDP 0.37%, consumption 0.33%; 6 of 8 computed variables within band. (The working paper reports GDP 2.2% and consumption 3.6% for the same 2026Q1&ndash;2027Q4 window &mdash; the difference is the EFO vintage it was anchored to, November 2025 against March 2026 here, not the window.)</td>
</tr>
<tr>
<th scope="row"><strong>Free-running</strong></th>
Expand Down
60 changes: 60 additions & 0 deletions papers/boe-svar/figures/latest_shocks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"quarter": "2026Q1",
"provenance": {
"model_id": "boe-svar",
"package": "boe_var",
"package_version": "0.1.0",
"model_version": "0.1.0",
"adapter_version": "0.2.0",
"source_url": "https://github.com/PolicyEngine/boe-var-model",
"source_revision": "3ab56259224c20a0bf65caa523e6e7440e56b37e",
"data_vintage": "conditioned through 2026Q1",
"baseline_vintage": "identified structural shocks",
"baseline": "identified structural shocks",
"estimation_sample": "1992Q1-2025Q1",
"run_at": "2026-08-12T13:41:15.541729+00:00",
"reproducibility": "Check out the recorded source URL at the recorded source revision, install the recorded adapter version, and rerun the serialized request against the recorded baseline and data vintage."
},
"draws": 6000,
"accepted_draws": 430,
"ess": 197.9,
"warnings": [],
"shocks": [
{
"shock": "World demand",
"p_positive": 0.287,
"p_negative": 0.713,
"reading": "World demand shock was probably negative in 2026Q1 (P(\u2212) = 0.71)."
},
{
"shock": "World energy",
"p_positive": 0.105,
"p_negative": 0.895,
"reading": "World energy shock was clearly negative in 2026Q1 (P(\u2212) = 0.90)."
},
{
"shock": "World supply",
"p_positive": 0.873,
"p_negative": 0.127,
"reading": "World supply shock was clearly positive in 2026Q1 (P(+) = 0.87)."
},
{
"shock": "UK demand",
"p_positive": 0.809,
"p_negative": 0.191,
"reading": "UK demand shock was clearly positive in 2026Q1 (P(+) = 0.81)."
},
{
"shock": "UK supply",
"p_positive": 0.715,
"p_negative": 0.285,
"reading": "UK supply shock was probably positive in 2026Q1 (P(+) = 0.71)."
},
{
"shock": "UK mon. pol.",
"p_positive": 0.16,
"p_negative": 0.84,
"reading": "UK mon. pol. shock was clearly negative in 2026Q1 (P(\u2212) = 0.84)."
}
]
}
9 changes: 4 additions & 5 deletions svar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,10 @@ <h2>What's happening now, and why.</h2>
by negative world-demand (probability <strong>0.71</strong>) and
world-energy (<strong>0.90</strong>) shocks, against positive UK
demand (<strong>0.81</strong>) and expansionary monetary policy
(<strong>0.84</strong>); the composite effect revises the
year-on-year path by <strong>+0.27pp on GDP growth</strong> at impact
and <strong>+0.22pp on CPI inflation</strong> at its peak three
quarters out.
</p>
(<strong>0.84</strong>). Source and provenance:
<a class="mono" href="/papers/boe-svar/figures/latest_shocks.json" download><code>latest_shocks.json</code></a>,
6,000 draws, 430 accepted, ESS 198.
</p>
<div class="callout">
<strong>It does not score reforms.</strong> Mapping a policy reform
into identified structural innovations is conceptually dubious, not
Expand Down