Aggregate SUM at a finer entity counts a group value once per unit inside it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reading Aggregate and ChangeAggregate and the map_to_entity behavior referenced in the issue, then compare it with the divide handling after issue #768. Reproduce the household-to-person SUM example and check crossing groups. The issue asks for a design decision between refusing SUM and splitting values by member share; done requires choosing and applying consistent behavior for both cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Aggregate and ChangeAggregate map a variable to the requested entity through map_to_entity's default how="sum". Mapping a group to the people or smaller groups inside it copies the group's value to each one, which a mean or a decile needs. A SUM then adds every copy, so
Aggregate(
simulation=sim,
variable="household_net_income",
entity="person",
aggregate_type=AggregateType.SUM,
)
counts each household's net income once per member. The overcount grows with the number of target units in each household, and on the certified US data (populace_us_2024, revision 0ff35303) the average household, weighted, holds:
| Target entity | Units |
|---|---|
| person | 2.78 |
| marital_unit | 2.11 |
| tax_unit | 1.33 |
| family | 1.11 |
| spm_unit | 1.04 |
Crossing groups double-count too: when a source group's members sit in several target groups, sum gives the full value to each. In the same data, 697 of 79,729 tax units (0.60% household-weighted) span two or more families, at least one of which also holds another tax unit, and 1 tax unit spans two SPM units.
The country analyses here aggregate each program at its own entity and never take this path. A caller that names a finer entity does: policyengine-uk-chat's aggregate_result tool passes the entity its model picks (person, benunit or household) to Aggregate.
@anth-volk, should Aggregate refuse SUM when the target entity sits inside the variable's entity, or split the value by member share as divide does after #768? Crossing groups need the same choice.
- Lingua principale
- Python
- Stelle
- 10
- Fork
- 10
- Merge medio
- 2g 2h
- PR unite (30g)
- 16
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine.py
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
PolicyEngine/policyengine.py#771 ·
I maintainer di solito rispondono entro 1 giorno
-
Model version publishes the new UK firm entity as a personForse già presa @vahid-ahmadi l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine.py#764 ·
I maintainer di solito rispondono entro 1 giorno
-
Raise the simulation cache memory warning to 16 GiBForse già presa @anth-volk l’ha presa 57 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PolicyEngine/policyengine.py#549 ·
I maintainer di solito rispondono entro 1 giorno
-
README population quickstart still teaches enhanced_frs_2023_24Forse già presa @vahid-ahmadi l’ha presa 35 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine.py#473 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PolicyEngine/policyengine.py#436 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PolicyEngine/policyengine.py
Issue simili
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NousResearch/hermes-official-plugins#538 ·
I maintainer di solito rispondono entro 3 giorni
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidateForse già presa @houzhongyu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MakazhanAlpamys/Soup#3415 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni