Repository navigation
Description
Problem
The UK SVAR adapter publishes the model's four-quarter log difference as if it were the simple four-quarter rate that ONS, the BoE MPR and the OBR EFO publish.
integration/src/policyengine_macro/core.py:1365(main 153cf41), insvar_forecast:yoy_paths.append(forecast.yoy(np.vstack([tail, path]))).boe_var.forecast.yoyisx_t - x_{t-4}on 100·log levels, which is 100·log(P_t/P_{t-4}). The medians and 68/90 bands go out unchanged as "YoY %".core.py:3850-3851, in the SVAR inflation-incidence tool:svar_cpi_yoy_pct(log basis, from the same path) is differenced againstreference_cpi_yoy_pct(a published simple rate). So the gap mixes units with the forecast difference.
The simple rate is above the log rate by about x²/200: +0.04pp at 2.8% CPI, +0.13pp at 5%, +0.5pp at 10%. For 2026 CPI near 3%, that is about 0.03–0.05pp on every archived CPI row on /forecasts, which is small but has a consistent sign. In a 2022-style episode it is about half a point.
Upstream fix
PolicyEngine/boe-var-model adds forecast.yoy_pct and forecast.log_to_simple_pct (draft PR PolicyEngine/boe-var-model#18). The map 100·expm1(x/100) is monotone, so applying it to the aggregated median and band edges gives exactly the bands of the converted paths. There is no need to convert each path.
What the adapter should do (not done here)
- In
svar_forecast, convertbandswithforecast.log_to_simple_pctafter aggregating. Fall back to100*np.expm1(x/100)for olderboe_varversions without the helper. - Use the converted CPI value for
svar_cpi_yoy_pctat :3850, so the gap at :3851 is simple minus simple. - Archived forecast rounds: leave the vintages as they are (append-only). Add a basis note to rounds before the change, so a scorecard does not mix log-basis and simple-basis errors without flagging it. Alternatively, convert at scoring time. The conversion is exact for medians and bands, so either option is safe.
- Add a test: for a known level path, the adapter's YoY must match
100*(P_t/P_{t-4}-1).
Decision for Vahid
Decide whether the scorecard should re-express past SVAR rounds on the simple basis at scoring time (recommended: it is exact and keeps the vintages untouched), or leave them on the log basis with a note.
🤖 Generated with Claude Code
Activity
vahid-ahmadi commentedon Nov 6, 2026
Triage (6 Nov): the adapter fix is on draft PR #216, commit e2ef675 (future rounds on the simple basis). The hosted server still reports the log basis until it is redeployed (found by the drift check, #229). The decision below remains open: whether to re-express the archived SVAR rounds at scoring time.
vahid-ahmadi commentedon Nov 25, 2026
The open decision is implemented in #285 the way this issue recommends:
forecasts/score.pyconverts the two July rounds from the log difference to the simple rate as it reads them, and the round files are untouched.Effect on the published scorecard: average miss 0.34 → 0.33pp, average signed error −0.33 → −0.31pp; the three scored July CPI errors shrink by 0.03–0.04pp and the four GDP errors by 0.01pp. No band result changes. A guard test makes every boe-svar round either state the simple basis in its
unitsor be listed for conversion.If the other option is preferred (leave the log basis and add a note), close #285. Either way this issue can close once that is settled; the adapter side has been on main since #216 (
e2ef6752).🤖 Generated with Claude Code