Poverty gap docstrings overclaim FGT indices, and the poverty estimators have no tests
Mantenedores costumam responder em até 1 dia
@juaristi22 já está trabalhando nisso.
Desde 22/9/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
MicroDataFrame.squared_poverty_gap (microdataframe.py line 812) sums (threshold - income) ** 2 over people in poverty and returns that total. Its docstring says the result is "also known as the poverty severity index". It is not: the FGT severity index is the mean of the squared normalised gap, (1/N) Σ ((z - y) / z)^2, dimensionless and in [0, 1]. What the method returns is in currency squared.
poverty_gap and deep_poverty_gap are likewise unnormalised currency totals, not FGT(1). Only poverty_rate is an FGT index.
The test suite has no test of poverty_rate, deep_poverty_rate, poverty_gap, deep_poverty_gap or squared_poverty_gap (grep poverty microdf/tests/ finds only poverty_count).
Fix:
- Docstrings: state exactly what each returns (weighted headcount rate; weighted aggregate gap in currency units; weighted aggregate squared gap in currency squared) and drop "poverty severity index".
- Either add normalised FGT(1) and FGT(2) as
poverty_gap_index/poverty_severity_index, or state in the docs that they are out of scope. - Tests for all five methods with hand-computed expected values on a three-row frame with non-uniform weights, including a row exactly at the threshold and a zero-weight row.
- Linguagem predominante
- Python
- Estrelas
- 16
- Forks
- 10
- Merge médio
- 5d 3h
- PRs com merge (30d)
- 21
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PolicyEngine/microdf
-
docs/examples.md still says MicroDataFrame.cov() and .corr() are unweightedTalvez já em andamento @juaristi22 assumiu há 6 dias. Aberta
PolicyEngine/microdf#335 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Fail closed: aggregation and construction paths that silently return unweighted resultsTalvez já em andamento @juaristi22 assumiu há 6 dias. Abertabug
PolicyEngine/microdf#333 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
PolicyEngine/microdf#314 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 65/100
PolicyEngine/microdf#264 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
PolicyEngine/microdf#223 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de PolicyEngine/microdf
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
spec-kitty/spec-kitty#5319 ·
Mantenedores costumam responder em até 1 dia
-
backend::vllm diffusion multimodal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
openai/openai-agents-python#5229 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia