Skip to content

Fit S3's interpolation form, and build the materials seed (#698) - #715

Draft
WesIngwersen wants to merge 2 commits into
step3_gov_function_bridgefrom
step3_materials_interpolation
Draft

Fit S3's interpolation form, and build the materials seed (#698)#715
WesIngwersen wants to merge 2 commits into
step3_gov_function_bridgefrom
step3_materials_interpolation

Conversation

@WesIngwersen

Copy link
Copy Markdown
Member

Stacked on #714.

S3's last open item was the interpolation form. It is fitted, and ❌ the
candidate this plan named is not the answer.

First, two different questions were being called "interpolation"

The materials level is observed every year (ASM→2021, AIES 2023), so it never
needed interpolating — §4 rules out doing so. The commodity mix is observed
only at 2017 and 2022, and nothing observes its interior: the fuels share of
the census universe stays between 0.98% and 1.14% across the span, so the coarse
annual partition constrains the mix hardly at all.

❌ The price-carried path is rejected

frame best θ gain over frozen
direct + group −0.25 +0.4%
unsuppressed, direct + group 0.00 0.0%

The level moves with price; the mix does not.

⚠️ The summary panel cannot arbitrate the form

The obvious test — interpolate between two summary years, score the years
between — is circular, and its answer must not be used. BEA carries the last
benchmark forward, so every interior year of a summary span is itself an
interpolation. And since BEA has not incorporated the 2022 Economic Census,
its 2022–2024 tables are still 2017-benchmark carries, so a span ending
anywhere in the nowcast horizon is contaminated at the endpoint as well.

✅ The benchmark detail panel can arbitrate it — a second use for what S0a
built. 2007, 2012 and 2017 are three independent Economic-Census-anchored
observations. Interpolate 2007→2017, score at the observed 2012:

form manufacturing whole table
frozen at 2007 0.0889 0.1323
linear 0.0764 0.1190
geometric 0.0710 0.1164
endpoint — adopt 2017 at once 0.1216 0.1712

✅ Interpolating beats freezing by 20.1%, geometric beats linear by 7.1%,
and ❌ adopting the newer observation immediately is worse than freezing — so
"just seed every year from the 2022 census" loses to doing nothing.

❌ But do not extend the trend past the last observation

form manufacturing whole table
hold the 2012 mix 0.1232 0.1733
linear trend extended 0.1569 0.2455
geometric trend extended 0.1513 0.2546

27.4% worse on manufacturing, 41.7% on the whole table. A mix trend does not
persist.

What ships

An asymmetry, every leg measured: geometric between the censuses, 2022 held
flat for 2023–24.
materials_seed(year) is an index on the share (not the
level — §The 2017 anchor) with the column total held, since Step 3 owns the level
through GO − VAPRO.

year treatment moved from frozen
2017 census observed 0.0000
2018–2021 interpolated 0.0192 → 0.0770
2022 census observed 0.0979
2023–2024 held at 2022 0.0979

The 0.0979 sits alongside §The mix score's independently-computed 0.0949 — the
construction checking out.

⚠️ One clean interior observation on a ten-year span, transferred to the
census's five-year one. It settles which form; it does not prove the form right.

New CLI: --form, --seed. Gates: ruff check . clean, mypy bedrock clean
(bar 4 pre-existing Windows-only resource errors), pytest 795 passed.

🤖 Generated with Claude Code

WesIngwersen added a commit that referenced this pull request Aug 25, 2026
The materials interpolation commit d722010 left three constructs black 24.10
rewrites: a parenthesised return annotation on _census_mix_frames, a split
%-format key in interpolation_forms' assign, and a nested conditional in the
census-mix treatment label. Formatting only -- no behaviour changes.

This is the format gate failing on PR #715 and, inherited, on #717 and the
service seed branch stacked above it. Fixed here so one change clears all three
rather than each branch carrying its own.

Gates: black, ruff, mypy clean; pytest 795 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
WesIngwersen added a commit that referenced this pull request Aug 26, 2026
The materials interpolation commit d722010 left three constructs black 24.10
rewrites: a parenthesised return annotation on _census_mix_frames, a split
%-format key in interpolation_forms' assign, and a nested conditional in the
census-mix treatment label. Formatting only -- no behaviour changes.

This is the format gate failing on PR #715 and, inherited, on #717 and the
service seed branch stacked above it. Fixed here so one change clears all three
rather than each branch carrying its own.

Gates: black, ruff, mypy clean; pytest 795 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@WesIngwersen
WesIngwersen force-pushed the step3_materials_interpolation branch from ec27a63 to 454ddb4 Compare August 26, 2026 18:30
WesIngwersen and others added 2 commits August 26, 2026 14:31
The form left open by S3 is settled, and the candidate the plan named is
not the answer.

Separate the two things called "interpolation" first. The materials LEVEL
is observed every year (ASM to 2021, AIES from 2023), so it never needed
interpolating and section 4 rules out doing so. The commodity MIX is
observed only at 2017 and 2022, and nothing observes its interior -- the
fuels share of the census universe stays between 0.98% and 1.14% -- so the
open question was only ever about the mix.

The price-carried path is rejected. Carrying the 2017 census mix to 2022 on
the commodity price ratio fits theta = 0.00 on the unsuppressed frame and
-0.25 (+0.4%) on the full one. The level moves with price; the mix does not.

The published summary panel cannot arbitrate the form and its answer must
not be used: BEA carries the last benchmark forward, so every interior year
of a summary span is itself an interpolation, and since BEA has not taken up
the 2022 Economic Census its 2022-2024 tables are still 2017-benchmark
carries -- so spans ending in the nowcast horizon are contaminated at the
endpoint too. The benchmark detail panel can arbitrate it, because 2007,
2012 and 2017 are three independent Economic-Census-anchored observations.

Interpolating 2007 -> 2017 and scoring at the observed 2012, manufacturing:
frozen 0.0889, linear 0.0764, geometric 0.0710, endpoint 0.1216. So
interpolating beats freezing by 20.1%, geometric beats linear by 7.1%, and
adopting the newer observation early is worse than freezing.

But do not extend the trend past the last observation: reaching 2017 from
2007 and 2012, holding the 2012 mix scores 0.1232 against 0.1569 linear and
0.1513 geometric -- 27.4% worse on manufacturing, 41.7% on the whole table.

S3 therefore ships an asymmetry: geometric interpolation between the two
censuses, and the 2022 mix held flat for 2023 and 2024. materials_seed()
is that seed, an index on the share with the column total held, moving the
block 0.0979 off frozen 2017 by 2022 -- alongside the independently
computed 0.0949 in the mix score section.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The materials interpolation commit d722010 left three constructs black 24.10
rewrites: a parenthesised return annotation on _census_mix_frames, a split
%-format key in interpolation_forms' assign, and a nested conditional in the
census-mix treatment label. Formatting only -- no behaviour changes.

This is the format gate failing on PR #715 and, inherited, on #717 and the
service seed branch stacked above it. Fixed here so one change clears all three
rather than each branch carrying its own.

Gates: black, ruff, mypy clean; pytest 795 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@WesIngwersen
WesIngwersen force-pushed the step3_materials_interpolation branch from 454ddb4 to c077b45 Compare August 26, 2026 18:31
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