feat(analysis): make the two explanations of the N change reproducible - #877
Open
WesIngwersen wants to merge 1 commit into
Open
feat(analysis): make the two explanations of the N change reproducible#877WesIngwersen wants to merge 1 commit into
WesIngwersen wants to merge 1 commit into
Conversation
Both tables had been produced by hand and quoted in write-ups, so nobody could re-run them after a rebuild. They are now one script, and both come from a single derivation of B and A because deriving them takes minutes and the two views have to describe the same build. Table 1 holds one of A / B at the baseline and moves the other, which is the only way to say whether a change in N came from the IO rebuild or the GHG regeneration. It reports D = 1'B alongside as the control on the B row: if B moves D and N alike the change is a level shift, and if D moves much more it sits in sectors nothing depends on. Table 2 factors N per sector into the output multiplier and the average intensity of what that multiplier pulls, which is the version that can be said out loud - "a dollar drags less of the economy behind it" versus "what it drags is cleaner" - with the size of each. Validation that this reproduces the hand method rather than something adjacent: the baseline column lands on 0.5033 col sum of A, 2.0064 multiplier and 0.0930 kg CO2e/$ average intensity, matching the figures quoted last week to four decimals. On the current build the emphasis has flipped. The multiplier effect halved (-4.0% to -2.69%) because the merged stack brought the median col sum of A back to 0.5030 against v0.3's 0.5033, while the intensity effect grew to -4.94%. The fall in N is now mostly a cleaner mix rather than a shorter supply chain.⚠️ Neither table is an identity. N is not additive in A and B, so table 1's middle rows do not sum to its first; and medians are per row, so table 2's components do not multiply to its N row. Both say the size of an effect, not a decomposition that closes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bl-young
requested changes
Sep 8, 2026
|
|
||
| from bedrock.analysis.nowcasting.results._ef_smoke_lib import ( | ||
| NOWCAST_COMPARE_YEAR, | ||
| V03_SNAPSHOT, |
Member
There was a problem hiding this comment.
this comes from _ef_smoke_lib which still pints the v0.3.1 model, which doesn't include the MECS update. We need to bump that to v0.3.2.
There may be other related updates as well needed alongside this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both of these tables had been produced by hand and quoted in write-ups. Nobody could re-run them after a rebuild, which is how an explanation goes stale without anyone noticing. They are now one script, and both come from a single derivation of B and A — deriving them takes minutes, and the two views have to describe the same build or they are not comparable.
Table 1 — which input moved N
Holds one of A / B at the baseline and moves the other. This is the only way to say whether a change in N came from the IO rebuild or from the GHG regeneration.
D = 1'BDis the control on the B row: if B movesDandNalike the emissions change is a level shift; ifDmoves much more, it sits in sectors nothing else depends on and never propagates. It now moves more than twice what B-only moves N, which is a real change in character from the previous run.Table 2 — the mechanism, in units you can say out loud
Nfactors exactly, per sector:Validation that this reproduces the hand method rather than something adjacent: the baseline column lands on 0.5033 / 2.0064 / 0.0930, matching the figures quoted by hand last week to four decimals.
The emphasis has flipped since then. The multiplier effect halved (−4.0% → −2.69%) because the merged stack brought the median column sum of A back to 0.5030 against v0.3's 0.5033 — the export re-splits, purchaser-value margin anchor and EC conditioning restored intermediate input intensity the earlier build had lost. Meanwhile the intensity effect grew to −4.94%. The fall in N is now mostly a cleaner mix rather than a shorter supply chain. Table 1 agrees independently: A's contribution halved while B's grew.
Nis not additive in A and B, so table 1's middle rows do not sum to its first; the remainder is their interaction.Both report the size of an effect, not a decomposition that closes. The script prints that under each table so a reader cannot take the sum.
Testing
Analysis script, so no unit tests per repo convention. The reproduction check is the baseline column matching the hand figures, and it prints on every run alongside the MUT vintage and sector count, so a replay states what it ran on.
🤖 Generated with Claude Code