Poverty gap docstrings overclaim FGT indices, and the poverty estimators have no tests
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- Python
- Stars
- 16
- Forks
- 10
- Avg merge
- 13h 43m
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PolicyEngine/microdf
-
docs/examples.md still says MicroDataFrame.cov() and .corr() are unweightedPossibly taken @juaristi22 claimed this 20 days ago. Open
PolicyEngine/microdf#335 · 1 assignee ·
Maintainers usually reply within 1 day
-
Fail closed: aggregation and construction paths that silently return unweighted resultsPossibly taken @juaristi22 claimed this 20 days ago. Openbug
PolicyEngine/microdf#333 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
PolicyEngine/microdf#314 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
PolicyEngine/microdf#264 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
PolicyEngine/microdf#223 ·
Maintainers usually reply within 1 day
All issues in PolicyEngine/microdf
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
adri0/scadustats#128 ·
Maintainers usually reply within 1 day
-
`TIMESTAMP`, `TIMESTAMP_NTZ`, `TINYINT` and the other `TypeDecorator`s don't declare `python_type`Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
RPBCOpenawaiting policy acceptance precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Bioconductor/BiocContributions#240 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
documentation good first issue launch
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
FlologixAI/etchwork#4 ·