Skip to content

feat(analysis): visualize row-wise summary-bundle effect on Detail A electricity coefficients#452

Open
MoLi7 wants to merge 1 commit into
mainfrom
mo__a-matrix-bundle-effect
Open

feat(analysis): visualize row-wise summary-bundle effect on Detail A electricity coefficients#452
MoLi7 wants to merge 1 commit into
mainfrom
mo__a-matrix-bundle-effect

Conversation

@MoLi7

@MoLi7 MoLi7 commented Jun 4, 2026

Copy link
Copy Markdown
Member

What changed? Why?

Adds a new analysis folder bedrock/analysis/a_matrix_bundle_effect/ that visualizes how scale+inflate moves detail-level electricity input coefficients, organized by BEA 2017 summary bundle.

For each detail commodity j it compares A[221100, j] between:

  • 2017 Detail Aderive_cornerstone_Aq() (BEA 2017 benchmark, pre-scaling)
  • post scale+inflate Detail Aderive_cornerstone_Aq_scaled() at model_base_year (2023)

with each year's summary-bundle anchor computed as the output-weighted mean of that year's coefficients within the bundle (the bundle-aggregate coefficient implied by the detail A).

Motivation: makes the "bundle crushing" effect of summary-based scaling visible — within-bundle outliers (e.g. industrial gases, cement, primary aluminum) get pulled toward the bundle anchor while the anchor itself barely moves. Supports the A-matrix method comparison in #337.

row-wise bundle effect if column-wise ABSR (does NOT reflect bedrock codepath)

electricity-bundle-crushing-top8

row-wise bundle effect if cell-to-block ABSR via scaling (reflects bedrock codepath)

electricity-bundle-crushing-top8

Run with:

uv run python -m bedrock.analysis.a_matrix_bundle_effect.visualize_bundle_effect_in_A

Testing

  • Ran the module end-to-end; all three PNGs render as expected.
  • Local CI parity: black --check ., ruff check ., mypy bedrock (424 files clean), pytest (216 passed, 3 skipped, 1 xfailed).

🤖 Generated with Claude Code

…ty coefficients

Add bedrock/analysis/a_matrix_bundle_effect/ comparing the electricity
(221100) input coefficient per detail commodity between the 2017 Detail A
(derive_cornerstone_Aq) and the post scale+inflate Detail A
(derive_cornerstone_Aq_scaled, model_base_year), grouped by parent BEA 2017
summary bundle.

Renders per-bundle dispersion plots (detail dots vs output-weighted
summary-bundle anchors for both years) and an all-commodity 2017-vs-scaled
scatter, showing how scaling pulls within-bundle outliers toward the bundle
anchor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

MoLi7 commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@MoLi7 MoLi7 changed the title feat(analysis): visualize summary-bundle effect on Detail A electricity coefficients feat(analysis): visualize row-wise summary-bundle effect on Detail A electricity coefficients Jun 4, 2026
@MoLi7 MoLi7 marked this pull request as ready for review June 4, 2026 02:43
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