Poverty gap docstrings overclaim FGT indices, and the poverty estimators have no tests
维护者通常 1 天内回复
@juaristi22 已经在做这个了。
开始于 2026年9月22日。
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Python
- 星标
- 16
- 派生
- 10
- 平均合并
- 5 天 3 小时
- 30 天内合并 PR
- 21
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PolicyEngine/microdf 的其他 Issue
-
docs/examples.md still says MicroDataFrame.cov() and .corr() are unweighted可能已有人在做 @juaristi22 于 7 天前认领。 未关闭
PolicyEngine/microdf#335 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Fail closed: aggregation and construction paths that silently return unweighted results可能已有人在做 @juaristi22 于 7 天前认领。 未关闭bug
PolicyEngine/microdf#333 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
PolicyEngine/microdf#314 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 65/100
PolicyEngine/microdf#264 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 45/100
PolicyEngine/microdf#223 ·
维护者通常 1 天内回复
查看 PolicyEngine/microdf 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
PedestrianDynamics/pyFDS-Evac#343 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
theskumar/python-dotenv#708 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 2 天内回复
-
Docs Timedelta
难度 2/5 1-3 小时 新手友好度 72/100
pandas-dev/pandas#69919 ·
维护者通常 1 天内回复
-
API documentation
难度 2/5 1-3 小时 新手友好度 72/100
zephyrproject-rtos/west#1009 · 2 条评论 ·
维护者通常 3 天内回复