Aggregate SUM at a finer entity counts a group value once per unit inside it
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 10
- Forks
- 10
- Merge moyen
- 2 j 2 h
- PR mergées (30 j)
- 16
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PolicyEngine/policyengine.py
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
PolicyEngine/policyengine.py#771 ·
Les mainteneurs répondent en général sous 1 jour
-
Model version publishes the new UK firm entity as a personPeut-être pris @vahid-ahmadi l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
PolicyEngine/policyengine.py#764 ·
Les mainteneurs répondent en général sous 1 jour
-
Raise the simulation cache memory warning to 16 GiBPeut-être pris @anth-volk l’a pris il y a 57 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
PolicyEngine/policyengine.py#549 ·
Les mainteneurs répondent en général sous 1 jour
-
README population quickstart still teaches enhanced_frs_2023_24Peut-être pris @vahid-ahmadi l’a pris il y a 35 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
PolicyEngine/policyengine.py#473 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
PolicyEngine/policyengine.py#436 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de PolicyEngine/policyengine.py
Issues similaires
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NousResearch/hermes-official-plugins#538 ·
Les mainteneurs répondent en général sous 3 jours
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidatePeut-être pris @houzhongyu l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
MakazhanAlpamys/Soup#3415 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours