Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Poverty gap docstrings overclaim FGT indices, and the poverty estimators have no tests

Aperta
#334 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@juaristi22 ci sta già lavorando.

Dal 22/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
Python
Stelle
16
Fork
10
Merge medio
5g 3h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PolicyEngine/microdf

Tutte le issue di PolicyEngine/microdf

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.