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
26 changes: 14 additions & 12 deletions connect/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ <h1 class="reveal page-title" style="--d:1;">
<p class="lede reveal" style="--d:2;">
Three routes to the same models. Start with MCP below — it needs no
install, no PolicyEngine account and no API key, though some clients
gate custom connectors by plan. Use the CLI or Python when you want the
gate custom connectors by plan. That is true of the hosted route; a
<em>local</em> UK population or reform-scoring run additionally needs a
HuggingFace token, as below. Use the CLI or Python when you want the
models in a script, or need one of the local-only members.
</p>
</div>
Expand Down Expand Up @@ -368,10 +370,19 @@ <h2>Connect in three steps.</h2>
takes around 20 seconds while the tax-benefit models load; a UK
forecast runs a couple of minutes on first call. Other tools
respond faster.</span></p>
<p class="vmet-notes-line"><span class="vmet-notes-key">uk microdata</span>
<span>Running a UK <em>population</em> or reform score locally needs
<code>HUGGING_FACE_TOKEN</code> from an account with access to the
private <code>policyengine/policyengine-uk-data-private</code>
dataset. UK household calls, every US call, and every hosted call
need nothing.</span></p>
<p class="vmet-notes-line"><span class="vmet-notes-key">local only</span>
<span>OG-UK long-run scoring (<code>score_reform</code> with
<code>model='og'</code>) and <code>dynamic_reform_impact</code> take
tens of minutes — the hosted server points you to the local CLI.
tens of minutes and are excluded from the hosted image;
<code>dynamic_reform_impact</code> returns the two-step local recipe,
while <code>model='og'</code> returns an import error — use the local
CLI for both.
The three <code>define_*</code> tools likewise return run instructions rather than results when called on the hosted server &mdash; the unlicensed upstream is never hosted. Everything else here runs hosted.</span></p>
</div>
</div>
Expand Down Expand Up @@ -443,7 +454,7 @@ <h2>Use Python directly.</h2>
</div>
<div class="model-pane compact-pane" id="model-panel-ogmicro" role="tabpanel" aria-labelledby="model-tab-ogmicro" data-model="ogmicro" hidden>
<span class="tag tag-local">local only</span><h3>Dynamic reform scoring</h3>
<p>Experimental, UK only: an OG-UK steady-state solve feeds long-run wage changes back into a second microsimulation run. Local only, and until <a href="https://github.com/PSLmodels/OG-UK/issues/68">OG-UK#68</a> the solve needs its own environment — run <code>pe-macro og-score --json &gt; og.json</code> there, then <code>pe-macro dynamic-score --og-payload og.json</code>.</p>
<p>Experimental, UK only: an OG-UK steady-state solve feeds long-run wage changes back into a second microsimulation run. Local only, and until <a href="https://github.com/PSLmodels/OG-UK/issues/68">OG-UK#68</a> the solve needs its own environment — run <code>pe-macro og-score --reform '{"gov.hmrc.income_tax.rates.uk[0].rate":0.21}' --json &gt; og.json</code> there, then <code>pe-macro dynamic-score --reform '{"gov.hmrc.income_tax.rates.uk[0].rate":0.21}' --og-payload og.json</code> &mdash; both steps need the same <code>--reform</code>.</p>
<a class="btn btn-primary" href="/olg/code#run">Open dynamic scoring setup</a>
</div>
<div class="model-pane compact-pane" id="model-panel-define" role="tabpanel" aria-labelledby="model-tab-define" data-model="define" hidden>
Expand Down Expand Up @@ -529,15 +540,6 @@ <h2>Use Python directly.</h2>
});
}

document.addEventListener("click", function (e) {
var btn = e.target.closest("[data-copy]"); if (!btn) return;
var container = btn.closest(".code-window") || btn.parentElement;
var code = container.querySelector("code");
navigator.clipboard.writeText(code.textContent).then(function () {
btn.textContent = "copied";
setTimeout(function () { btn.textContent = "copy"; }, 1400);
});
});
})();
</script>
<script>
Expand Down
12 changes: 1 addition & 11 deletions define/code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h4>Clone to rebuild the validation record</h4>
<h4>The path to hosting</h4>
<p class="opt-note">a clean-room Python reimplementation of the published Model Manual v1.1 is the route to a hostable model — protocol and milestones in <a href="https://github.com/PolicyEngine/define-uk-model/blob/main/REIMPLEMENTATION.md">REIMPLEMENTATION.md</a>, upstream code used only as a numerical oracle.</p>
<p>Four slices have landed. The §2.2 accounting core &mdash; the transactions and balance-sheet matrices &mdash; is satisfied identically at the manual's own initial values. §3.2 adds the high-level macroeconomic block, §3.3.1 domestic production, and §3.3.2 the power generation sector: <strong>118 equations, Eqs. (21)&ndash;(138), contiguous</strong>. §3.3.3 input&ndash;output and the comparison against the upstream oracle are outstanding, so <strong>nothing here is hostable yet</strong> and the hosted tools continue to return run instructions.</p>
<p>Reimplementing from the manual is also what surfaces its gaps, and roughly <strong>thirty-five</strong> are now pinned by tests rather than absorbed into a tolerance &mdash; a net-lending residual the manual itself says &ldquo;should equal 0&rdquo;, identities that fail at the manual's own initial values, and symbols the equations use that the parameter tables never list. The largest is a blocker: <strong>§3.3.2 as published cannot be simulated forward.</strong> Six parameters it uses are absent from Table 5, and two variables are never defined anywhere in the manual, so credit rationing collapses to a constant and desired power-sector investment turns negative. That is the section the climate-policy scenarios run through, and it is <a href="https://github.com/PolicyEngine/define-uk-model/blob/main/REIMPLEMENTATION.md">recorded in full</a> for the authors.</p>
<p>Reimplementing from the manual is also what surfaces its gaps, and <strong>thirteen</strong> are now pinned by tests as machine-readable gap records rather than absorbed into a tolerance, with more written up in the reimplementation notes &mdash; a net-lending residual the manual itself says &ldquo;should equal 0&rdquo;, identities that fail at the manual's own initial values, and symbols the equations use that the parameter tables never list. The largest is a blocker: <strong>§3.3.2 as published cannot be simulated forward.</strong> Six parameters it uses are absent from Table 5, and two variables are never defined anywhere in the manual, so credit rationing collapses to a constant and desired power-sector investment turns negative. That is the section the climate-policy scenarios run through, and it is <a href="https://github.com/PolicyEngine/define-uk-model/blob/main/REIMPLEMENTATION.md">recorded in full</a> for the authors.</p>
<div class="meth-inline">
<div class="meth-sec-title">development</div>
<div class="codeblock"><button class="cb-copy" data-copy>copy</button><pre><code>git clone https://github.com/PolicyEngine/define-uk-model
Expand Down Expand Up @@ -174,16 +174,6 @@ <h4>The path to hosting</h4>

<script src="/reveal.js?v=2" defer></script>
<script>
document.addEventListener("click", function (e) {
var btn = e.target.closest("[data-copy]"); if (!btn) return;
var code = btn.parentElement.querySelector("code");
navigator.clipboard.writeText(code.textContent).then(function () {
btn.textContent = "copied";
setTimeout(function () { btn.textContent = "copy"; }, 1400);
});
});
</script>
<script>
// Code scrollytelling: highlight the step at the reading line and
// show its code panel in the sticky aside.
(function () {
Expand Down
27 changes: 19 additions & 8 deletions define/validation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="hero-inner">
<p class="eyebrow reveal" style="--d:0">model 07 — ecological stock-flow consistent · define-uk · UK · experimental</p>
<h1 class="reveal page-title" style="--d:1;">
Validated to the ceiling the publications allow.
Validated where the publications allow it, and no further.
</h1>
<p class="lede reveal" style="--d:2">
The manual's macro block replicates; the emissions path diverges and
Expand Down Expand Up @@ -94,7 +94,7 @@ <h2>The replication gates, check by check.</h2>
<tr>
<th scope="row">Manual Table&nbsp;4, macro block — real GDP growth, unemployment, population 16+, labour force at 2025/2030/2040, S1 baseline</th>
<td>population and labour force &plusmn;0.01m; growth &plusmn;0.31pp; unemployment &plusmn;0.2pp</td>
<td><strong>PASS</strong> (2026-08-04) — growth exact at 2030/2040, &minus;0.30pp at 2025</td>
<td><strong>PASS</strong> (2026-08-04) — growth exact at 2030/2040, &minus;0.30pp at 2025 against a &plusmn;0.31pp gate: passing by 0.01pp is not the same as matching</td>
</tr>
<tr>
<th scope="row">Manual Table&nbsp;4, total emissions, S1 baseline</th>
Expand All @@ -109,7 +109,7 @@ <h2>The replication gates, check by check.</h2>
<tr>
<th scope="row">FMM-2023 anchors — green public investment GDP peak; baseline 2030 emissions</th>
<td>wide (pre-1.0 vintage): GDP peak 0.7&ndash;1.3%; emissions 330&ndash;352 MtCO2e</td>
<td><strong>PASS</strong> — peak +0.92% vs published &asymp;+1%; 342.8 vs &ldquo;just under 350&rdquo;</td>
<td><strong>PASS</strong> — peak +0.92% vs published &asymp;+1%; 342.8 vs &ldquo;just under 350&rdquo;. The tests assert membership of the wide bands, not these two figures</td>
</tr>
<tr>
<th scope="row">Published numeric scenario results for v1.1</th>
Expand Down Expand Up @@ -235,11 +235,22 @@ <h2>The fiscal multiplier, stated honestly.</h2>
Our own computation of the model's cumulative
green-public-investment multiplier — cumulative ΔGDP over cumulative
ΔSPEND_GVT, nominal, over the full simulation — is
<strong>1.78</strong>. IMF estimates of green-spending multipliers
run 1.1&ndash;1.5 (Batini et al. 2021); the OBR's capital-spending
impact multiplier is &asymp;1.0. Above but near the IMF range, as the
demand-led closure predicts, and labelled accordingly wherever a
delta is served.
<strong>1.78</strong>. It is <em>not</em> comparable to the published
green-spending multipliers it sat beside here — an IMF range of
1.1&ndash;1.5 and the OBR's &asymp;1.0 capital-spending impact
multiplier. Three things all push the same way. Ours is a
<em>cumulative ratio to 2040</em> set against short-horizon
multipliers. Its denominator <code>SPEND_GVT</code> is
<em>endogenous</em>: government investment is only 12.8% of it, and
social benefits fall when unemployment does, so a scenario that cuts
unemployment shrinks the denominator and biases the ratio up. And the
closure is demand-led with Kaldor&ndash;Verdoorn productivity and real
GDP not held to a supply ceiling, so a ratio above 1 over fifteen
years is what the model implies rather than a finding. The clean
comparison — cumulative ΔGDP over cumulative ΔGCF_GVTG — has not been
computed; until it is, treat 1.78 as upper-leaning. The caveats travel
with every served delta (<code>GPI_MULTIPLIER_CAVEATS</code>, gated by
test).
</p>
<p>
The upstream repository's own <code>Multiplier_Summary.csv</code> is
Expand Down
3 changes: 1 addition & 2 deletions economy/topics/growth/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<nav class="crumbs mono" aria-label="You are here">
<a href="/">Home</a>
<a href="/economy">Economy</a>
<a href="/economy/topics">Topics</a>
<span aria-current="page">Growth</span>
</nav>

Expand Down Expand Up @@ -148,7 +147,7 @@ <h2>The model view, and the same breath its limits.</h2>
</div>
<p class="callout">
<strong>Predictive validation: weak.</strong>
Against a no-change random walk the model looked strong on CPI (0.63 at h=1), but a driftless walk on a trending log level is too weak a benchmark: against a random walk WITH DRIFT the CPI ratio becomes 0.83 at h=1 and 1.03 at h=8, i.e. no better than naive. Bank Rate is the one series that improves under the harder benchmark (0.79 at h=1, p=0.018) and is the defensible forecasting claim. UK GDP is not distinguishable from either benchmark (p=0.38-0.67), and excluding six Covid-target origins its ratio falls to 0.77. The frozen-edge run gives 0.32pp RMSE from a single origin.
No demonstrated skill against a random walk WITH DRIFT on any variable at any horizon once the 64 variable-by-horizon tests are adjusted together: minimum Benjamini-Hochberg q = 0.36, and 0.40 under the published specification. A driftless walk on a trending log level is too weak a benchmark, so the strong-looking CPI result (0.63 at h=1) becomes 0.83 at h=1 and 1.03 at h=8 against drift. Bank Rate comes closest (0.79 at h=1, unadjusted p=0.018 -- the smallest of the 64) but does not survive the adjustment. UK GDP is not distinguishable from drift at any horizon (p=0.33-0.43). Two caveats on figures quoted elsewhere: the ex-Covid ratio of 0.77 and the p=0.38-0.67 range are against the weaker no-change benchmark, not drift. Separately, the rolling evaluation had estimated without the six Covid dummies that every published forecast carries; under the published specification UK GDP goes 1.06 to 0.99 at h=1 and 1.12 to 0.95 at h=8 -- level with naive rather than worse, still not better. The frozen-edge run gives 0.32pp RMSE from a single origin.
<a href="/svar/validation">Read the validation page →</a>
</p>
<p class="chooser-note">
Expand Down
3 changes: 1 addition & 2 deletions economy/topics/inflation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<nav class="crumbs mono" aria-label="You are here">
<a href="/">Home</a>
<a href="/economy">Economy</a>
<a href="/economy/topics">Topics</a>
<span aria-current="page">Inflation</span>
</nav>

Expand Down Expand Up @@ -137,7 +136,7 @@ <h2>The model view, and the same breath its limits.</h2>
</div>
<p class="callout">
<strong>Predictive validation: weak.</strong>
Against a no-change random walk the model looked strong on CPI (0.63 at h=1), but a driftless walk on a trending log level is too weak a benchmark: against a random walk WITH DRIFT the CPI ratio becomes 0.83 at h=1 and 1.03 at h=8, i.e. no better than naive. Bank Rate is the one series that improves under the harder benchmark (0.79 at h=1, p=0.018) and is the defensible forecasting claim. UK GDP is not distinguishable from either benchmark (p=0.38-0.67), and excluding six Covid-target origins its ratio falls to 0.77. The frozen-edge run gives 0.32pp RMSE from a single origin.
No demonstrated skill against a random walk WITH DRIFT on any variable at any horizon once the 64 variable-by-horizon tests are adjusted together: minimum Benjamini-Hochberg q = 0.36, and 0.40 under the published specification. A driftless walk on a trending log level is too weak a benchmark, so the strong-looking CPI result (0.63 at h=1) becomes 0.83 at h=1 and 1.03 at h=8 against drift. Bank Rate comes closest (0.79 at h=1, unadjusted p=0.018 -- the smallest of the 64) but does not survive the adjustment. UK GDP is not distinguishable from drift at any horizon (p=0.33-0.43). Two caveats on figures quoted elsewhere: the ex-Covid ratio of 0.77 and the p=0.38-0.67 range are against the weaker no-change benchmark, not drift. Separately, the rolling evaluation had estimated without the six Covid dummies that every published forecast carries; under the published specification UK GDP goes 1.06 to 0.99 at h=1 and 1.12 to 0.95 at h=8 -- level with naive rather than worse, still not better. The frozen-edge run gives 0.32pp RMSE from a single origin.
<a href="/svar/validation">Read the validation page →</a>
</p>
</div>
Expand Down
1 change: 0 additions & 1 deletion economy/topics/jobs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<nav class="crumbs mono" aria-label="You are here">
<a href="/">Home</a>
<a href="/economy">Economy</a>
<a href="/economy/topics">Topics</a>
<span aria-current="page">Jobs</span>
</nav>

Expand Down
1 change: 0 additions & 1 deletion economy/topics/public-finances/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<nav class="crumbs mono" aria-label="You are here">
<a href="/">Home</a>
<a href="/economy">Economy</a>
<a href="/economy/topics">Topics</a>
<span aria-current="page">Public finances</span>
</nav>

Expand Down
1 change: 0 additions & 1 deletion economy/topics/rates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<nav class="crumbs mono" aria-label="You are here">
<a href="/">Home</a>
<a href="/economy">Economy</a>
<a href="/economy/topics">Topics</a>
<span aria-current="page">Rates and gilts</span>
</nav>

Expand Down
1 change: 0 additions & 1 deletion economy/topics/reform/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<nav class="crumbs mono" aria-label="You are here">
<a href="/">Home</a>
<a href="/economy">Economy</a>
<a href="/economy/topics">Topics</a>
<span aria-current="page">Tax and benefit reform</span>
</nav>

Expand Down
Loading