Skip to content

Hold imports to BEA's summary groups in the balance, and condition service exports on the summary rows (#1288, #1250) - #1303

Draft
WesIngwersen wants to merge 3 commits into
mainfrom
service_trade_on_summary_groups
Draft

WesIngwersen wants to merge 3 commits into
mainfrom
service_trade_on_summary_groups

Conversation

@WesIngwersen

@WesIngwersen WesIngwersen commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Closes #1288 and #1250 once the rebuild grades clean. Both flags are off in this PR. They get turned on with the re-pin after the test rebuild, as #1260 and #1302 did.

What this does

1. hold_imports_on_summary_groups (#1288). #785 scales each summary group of the seed's imports (MCIF) to BEA's summary Supply table. The Step 5 balance, though, holds imports only as one soft column total (T7), and the service import cells are free, so the commodity identities move imports between groups. In 2017, service imports enter the balance at the published $267.2bn and leave at $247.0bn (v1.0.0_fd271dc).

With the flag, the balance holds MCIF by summary group, the same way it already holds TOP/SUB (GroupHold). The new import_group_holds targets BEA's summary MCIF for each group, less the frozen cells. The detail cells inside a group stay free, and the held groups replace the T7 column total. Restored service imports then raise those rows' supply, so the balance has to raise their use too, mostly business services bought by industries.

2. condition_service_exports_on_summary (#1250). Service exports (F04000) are each row's published 2017 value moved by a blend of ITA categories. By 2024 the blends are off by about 40% on data processing (514, +42.7%), administrative and support (561, -37.6%) and management of companies (55, +42.1%), 2018-2024 means on fd271dc. The balance barely moves exports, so the error is in the blends.

With the flag, condition_service_exports_on_summary scales each service summary group of F04000 to BEA's summary Use F040 for that year, with the guards nowcast_fd_conditioning already uses for the NIPA columns: an empty group or a sign disagreement keeps a factor of 1. The blends keep only the detail split inside each group. Goods exports stay on Census trade, and Other and Used are left alone. It runs in derive_initial_Y_pur after #1295's anchoring.

The balance then keeps those cells where conditioning put them: fix_service_exports makes the service F04000 cells Tier 1 fixed in the Use mask, so each row closes on its other cells. Without it the balance would move them again. On fd271dc it took pipelines' (486) export error from $47M to $527M a year, and banking's (521CI) from $51M to $673M.

Tests

  • import_group_holds targets the published groups less frozen cells. On a small Supply block where the rows would move imports between groups, the held block keeps each group and the industry column absorbs the move instead.
  • fix_service_exports fixes service export cells and leaves goods free.
  • Service export groups land on the published F040 (2023 workbook), goods rows don't move, and the split inside a group is unchanged. is_service_group excludes goods, government, Other and Used.

Test rebuild

Run 43442148416 on the throwaway branch service_trade_rebuild_check: this branch with both flags on in the nine v1.0 configs. Nothing is uploaded. It is graded with service_trade_vs_published against v1.0.0_fd271dc; results go here when it finishes.

🤖 Generated with Claude Code

WesIngwersen and others added 2 commits November 13, 2026 09:13
…vice exports on summary F040 (#1288, #1250)

Two flags, both off:

- hold_imports_on_summary_groups: the Step 5 balance holds MCIF by summary
  group (import_group_holds, the same GroupHold as TOP/SUB) instead of one
  soft column total. In 2017 service imports enter at the published
  $267.2bn and leave at $247.0bn.
- condition_service_exports_on_summary: each service summary group of
  F04000 is scaled to BEA's summary Use F040; the ITA growth blends keep
  only the detail split. Goods exports stay on Census trade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WesIngwersen WesIngwersen self-assigned this Nov 13, 2026
…itioned (#1250)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WesIngwersen

Copy link
Copy Markdown
Member Author

Test rebuild: both fixes work, and the tables still balance

Run 43442148416, build v1.0.0_826ea66: this branch with both flags on in the nine v1.0 configs. All 16 jobs passed. Nothing uploaded. Graded with service_trade_vs_published --build v1.0.0_826ea66 against v1.0.0_fd271dc.

Service exports (#1250). Every service row equals BEA's summary F040 after the balance in every year, 2018-2024, so the mean absolute error is $0 on every row. On fd271dc it was $0.4-4.7bn a row, with data processing (514) at +42.7%, administrative and support (561) at -37.6% and management of companies (55) at +42.1%.

Service imports (#1288). Within 0.1% of BEA every year:

service imports, $bn 2017 2018 2019 2020 2021 2022 2023 2024
published 267.4 264.7 280.9 253.6 281.8 316.8 358.3 408.3
fd271dc 247.0 243.8 270.0 229.1 263.6 287.7 337.3 386.7
826ea66 267.2 264.5 280.7 253.5 281.7 316.5 358.1 408.0

The largest remaining row miss is other professional services (5412OP), $51M a year on average.

Where the restored imports went. Service rows, 826ea66 minus fd271dc, $bn:

2017 2018 2019 2020 2021 2022 2023 2024
imports +20.1 +20.7 +10.7 +24.3 +18.1 +28.9 +20.8 +21.3
intermediate use +4.4 +6.6 +8.1 -2.5 -7.8 -11.7 -11.1 +0.4
final demand other than exports +4.2 +5.2 +3.7 +1.7 -0.8 -1.9 -0.9 +2.8
exports -5.5 -9.0 -8.4 +1.5 +5.6 +11.3 +13.6 +0.9
domestic production, Make -6.8 -7.0 -4.7 -7.1 -3.6 -4.1 -1.5 -3.4

Domestic production moves the same amount onto goods commodities, so industry output is unchanged. The largest moves are inside the professional services block: scientific R&D (541700) -$4.2bn in 2017 and -$5.7bn in 2022, management consulting (541610) -$1.8bn and -$2.9bn.

Balance. q = L_dom y passes in every year 2017-2024, with no failing commodity.

Next. Turning the flags on means a re-pin to a build of this code, as in #1302. v1.0.0_826ea66 is that build, so it can be uploaded and pinned once this merges, with no second rebuild. The throwaway branch service_trade_rebuild_check stays until then.

🤖 Generated with Claude Code

@WesIngwersen

Copy link
Copy Markdown
Member Author

Impact on N: small, with one outlier

Total emission factors (N) on the test build v1.0.0_826ea66 against v1.0.0_fd271dc, the v1.0 configs, with each build's own GHG flow-by-sector table. 404 sectors:

2017 2020 2024
median change -0.07% -0.18% 0.00%
output-weighted change -0.06% -0.24% -0.07%
output-weighted absolute change 0.15% 0.30% 0.25%
sectors moving more than 1% 9 12 6
sectors moving more than 5% 1 1 2

The largest movers other than the outlier are under 3.2% in every year: computers (334111) -3.1% in 2017, insurance carriers (5241XX) -1.7%, communications equipment (334210) -1.6%.

The outlier is S00102, other federal government enterprises: +11.8% in 2017, +14.9% in 2020 and +7.5% in 2024. Most of what that industry makes is other commodities. Of its $15.5bn of 2017 output, $9.2bn is insurance (5241XX, federal crop and flood insurance), $3.1bn general merchandise (452000, commissaries) and $1.4bn food service. With insurance imports restored, the balance takes about $0.9bn of insurance production off this industry's Make column and moves it to its retail and food-service products. The S00102 commodity is only $0.6-1.2bn, so that change in its industry's product mix shows up as a large percentage in its N. It is a side effect of where the balance absorbs the restored imports, not an error in the emissions.

🤖 Generated with Claude Code

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.

Service imports fall $5-10bn a year at the Step 5 balance on v1.0.0_8365fa4, with the same trade inputs as e7715da

1 participant