Repository navigation
fix: anchor MECS sector shares on 2022 with an annual path back to 2018 (#1210) - #1318
Open
catherinebirney wants to merge 9 commits into
Open
catherinebirney wants to merge 9 commits into
catherinebirney wants to merge 9 commits into
Conversation
catherinebirney
marked this pull request as ready for review
November 20, 2026 14:02
Member
Author
|
@WesIngwersen I've only run the I'm headed to the airport, but will try to update testing/run the ghg fbs when/if i can |
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.
cc: @MoLi7
Closes: #1210
What changed? Why?
Problem
Sector shares in
Energy_manufacturing_national_nowcast_{year}only changed when the method switched surveys: MECS 2018 through 2020, then MECS 2022 from 2021. So the whole 2018–2022 change landed in a single year (e.g.32511HGL share jumped at 2021). MECS 2022 also reports the chemical sector split far more fully than 2018 (natural gas and HGL), so the two surveys are not equally good end points.Fix
split_year: 2022), so there is no 2017→2022 switch in the split either.clean_fba_w_secstep,apply_mecs_annual_share_path(EIA_MECS.py), runs on the MECS activity sets (table_3_1_coal,table_3_1_ng,table_2_1,table_2_1_ng) after parent-incomplete-child remainders and sector mapping:w = lambda x min(2022 - t, 4) / 4(geometric when both shares are above 0, linear when one survey reports 0), then shares are renormalized so each fuel total stays at the MECS 2022 value.lambda = max(0, 1 - (v_2022 + v_2018) / (s_2018 - s_2022)^2), using EIA's published RSEs: the part of the survey-to-survey change larger than its sampling noise.*cells count as RSE 100%; a remainder adds its published children's variances.lambda = 0(keep the 2022 share) where the 2022 piece is 0, the 2018 cell is D/Q or GHGRP-filled, the piece is missing in 2018, its published children differ between surveys, or the fuel is Petroleum (2018 "Other" includes hydrogen, which 2022 reports in its own column).322121+322122→322120,336111+336112→336110) come fromNAICS_Year_Concordance, using the catalog'sby_yearvintages. A NAICS code that splits into several newer codes raises an error rather than being skipped.Checked and ruled out
325211: MECS gas ratio 2.13 vs GHGRP C 1.02;325199: 0.54 vs 1.03). We use a flat path, with RSE weighting deciding how much of the 2018 end point to trust.Spread= 0. The raw EIA RSE sheets publish those zeros, for cells where every plant is surveyed (e.g. all of331110, 311 coal), so they are used as published, with no floor.*(under 0.5, RSE 99.4%) vs a reported 0 in 2022. Not real changes, so they are not added back. After the renames, no 2018-only piece with a real value remains.table_2_1_ng705.75 bcf,table_3_1_ng6,796 bcf; HGL 976.75 million bbl).Testing
Fuel totals, every year 2017–2024
Petroleum energy shares stay on the 2022 values in every year (lambda_zero_flownames). The largest HGL, natural-gas, and coal shares:
HGL share of table_2_1, %
Natural gas feedstock share of table_2_1_ng, %
Natural gas fuel share of table_3_1_ng, %
Coal share of table_3_1_coal, %
The biggest single-year share step in this set is 2.41 points (325211 natural gas feedstock, 2021 to 2022). That step is one year of a 7.30-point move from 2018 to 2022, spread across 2019–2022. Coal sectors 31121, 311224, 311225, and 31123 are 0 in 2017 and 2018, so those four rows are absent from those two parquets, and they rise linearly after that.