Skip to content

Clean-room reimplementation track for DEFINE-UK 1.1 - #2

Merged
vahid-ahmadi merged 5 commits into
mainfrom
clean-room-reimplementation
Aug 4, 2026
Merged

Clean-room reimplementation track for DEFINE-UK 1.1#2
vahid-ahmadi merged 5 commits into
mainfrom
clean-room-reimplementation

Conversation

@vahid-ahmadi

Copy link
Copy Markdown
Contributor

Starts roadmap track for hosting DEFINE-UK regardless of the upstream licence (parallels the license request, addresses #1's hosting path).

  • REIMPLEMENTATION.md — clean-room protocol: spec = published Model Manual v1.1 + papers; the pinned upstream R run is an output oracle only, never read as source; every equation must cite a manual reference (enforced in code); input data from official ONS sources, not the upstream spreadsheets. Milestones by manual section with validation gates.
  • src/define_uk/model/Equation/Registry with required manual_ref and the manual's own equation taxonomy (identity/behavioural/calibrated); per-period Gauss–Seidel SFC solver that raises on non-convergence; ten sector modules mapped 1:1 to manual §3.1–§3.4.7 (no equations yet — they land per milestone).
  • tests — solver/registry unit tests on a toy fixture; oracle-comparison harness that skips until milestone 2 exists.

8 passed, 1 skipped locally (Python 3.13).

🤖 Generated with Claude Code

vahid-ahmadi and others added 5 commits August 4, 2026 14:18
…olver, sector skeletons

Implements from the published Model Manual v1.1 only; the pinned upstream
run is a numerical oracle (tests/test_oracle.py), never a source. Every
equation must carry a manual_ref — enforced by the Equation dataclass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…n; no upstream licence needed

Drops the license request as a roadmap prerequisite — the clean-room build
from the manual is the hosting path; upstream code remains an output oracle
only. Results surfaces credit DEFINE-UK's authors and state the
implementation is independent, matching the suite's adapted-model pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Manual Table 4 vs ONS outturns (macro repo vintages), OBR EFO, DESNZ
emissions, NDC path, and IMF/OBR multiplier benchmarks; flags the
scenario-invariant multiplier columns in upstream Multiplier_Summary.csv
as a probable computation artifact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gence recorded and gated

Calendar anchored via the population path (run = 1987Q1-2040Q4).
tests/test_replication_baseline.py runs against the cached pinned
upstream output and skips when absent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… licence

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vahid-ahmadi
vahid-ahmadi merged commit 95e9078 into main Aug 4, 2026
1 check passed
vahid-ahmadi added a commit that referenced this pull request Aug 12, 2026
An audit of the site flagged the claim that the emissions divergence had
been "raised with the authors" as unsupported, because nothing in this
repository recorded it. The claim was true — DEFINE_UK_1.1#1 exists and is
open — but the auditor was right that it was untraceable from here, which is
the same standard applied to every number in VALIDATION.md.

Both queries are now recorded with their issue links: #1 on the Table 4
emissions vintage, and #2 on §3.3.2's six untabulated parameters and two
undefined variables, which is why the section cannot be simulated forward as
published, together with Eq. (84)'s factor-of-three disagreement and Eq.
(61) contradicting the stated fuel-price normalisation.

The findings were re-verified against the transcribed tables before being
posted publicly: all eight symbols genuinely absent, Eq. (84) computing
0.9725 against a tabulated 0.3198, and the fuel-price normalisation
corroborated independently by IC_FUELPS and IC_FUELPSR both tabulating
15.75, which is only possible at P_FUEL = 1.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
vahid-ahmadi added a commit that referenced this pull request Aug 12, 2026
…ical-mean calibration (#12)

An independent audit re-derived every pinned discrepancy straight from
the manual's printed equations, without importing this repo's sector
modules, and re-checked all 661 calibration entries against the manual
page each cites. **661/661 transcribed correctly** — the only misses are
the two documented `SUBS_GVT`/`SUBS_PS` placeholders the tables genuinely
do not contain — and every piece of arithmetic here reproduced. What did
not survive was interpretation.

**One claim was wrong and is withdrawn.** On Eq. (51) this repo said "the
equation is the corroborated one, since Eqs. (49)+(50) imply 0.1598".
That evaluates a *lagged* equation — Eq. (49) reads UC_{t-1} — at
contemporaneous unit costs. Honouring the lag, the tabulated mu needs
+0.91%/quarter unit-cost growth while Eq. (51)'s mu needs **-0.12%, i.e.
deflation**; with the manual's initial period at 2022Q4 (Table 6 indexes
the deflator at Q4 2022, INF_A = 0.107, quarterly nominal GDP growth
1.019) the evidence points the other way. Table 5 also says alpha1MU is
calibrated to a *historical mean*, never to t=L. A first-period jump, not
a manual contradiction.

**Three more findings are the same class.** alpha_NELEC (Eq. 59) is "the
mean over past data" and 2022Q4 was a gas spike — the right direction and
roughly the right size for the 60% gap; alpha_DIVPPS (Eq. 94) and eta_PSB
(Eq. 111) are likewise past-data means. The gaps are real and matter
operationally, but none is the manual disagreeing with itself, and they
are no longer presented as if they were.

**Two mislocations.** Eq. (107)'s sign contradiction is not one of "four
in section 3.3.2": the identical alpha*GO rule is printed at Eqs. (177),
(231) and (284), and Table 6 tabulates all four transfers negative, out
by 1.7-4.6x. And Eqs. (27), (104), (105), (132), (133) are one finding,
not five — Table 6 deflates its entire capital block at 1.031 where the
equations prescribe P_P = 1.035, which looks like a national-accounts
investment deflator standing in for the production deflator.

**Eq. (84) gains a likelier explanation.** (1+1.228)x0.4365 = 0.9725
against a tabulated 0.3198 implies a *negative* mark-up, which no
historical mean can produce. Section 5 calibrates an electricity price
rule section 3 never prints: Table 5's `t_ELECswitch` is the quarter of
"the switch in the electricity price long-run formation rule" and Table
6's `P_ELECLR` is a "long run electricity price"; `P_ELECLR` occurs once
in the whole PDF and neither appears in any printed equation. The 3.04x
is most likely a missing equation, recorded as such.

The findings that carry weight survive intact and better supported: Eq.
(52) (Table 5 says alpha0WS was calibrated so the equation equals the
observed value at t=L; it does not, and 0.6233 is exactly W/GDP), Eq.
(61), Eq. (70), Eq. (108), Eq. (131), Eq. (136), the three sign
contradictions, the LENDM residual (the seven model-determined entries
sum to exactly 5.44 = -DIVN_ROW while national-accounts LEND sums to
-0.001), and all of issue #2 — six parameters and two variables that
occur in the body and in neither table. **Both filed upstream issues hold
in full**, and the wrong claim never left this file.

Also: the 1.78 green multiplier is recorded with the three properties
that make it upper-leaning rather than comparable — a cumulative ratio to
2040 set against short-horizon IMF/OBR multipliers, an endogenous
`SPEND_GVT` denominator of which investment is only 12.8% and social
benefits fall when unemployment does, and a demand-led closure with
Kaldor-Verdoorn productivity where >1 over fifteen years is what the
model implies. `test_oracle.py` keyed its skip on `Rscript` being present,
which is the wrong condition — the comparison needs upstream *outputs* —
and it is rekeyed on the cached run, with a test that fails the moment
section 3.3.3 lands so the outstanding gate stays visible in a green
suite.

229 -> 236 passed; no test removed or weakened.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant