Line references below are to commit 7952236, in openavmkit/vertical_equity_study.py.
get_vertical_equity_scores picks the quantile group count at lines 27-32:
if 20 <= observation_count <= 50:
percentile_group_count = 2
elif 51 <= observation_count <= 500:
percentile_group_count = 4
elif observation_count > 501:
percentile_group_count = 10
else:
...
The branches cover 20 to 50, 51 to 500, and greater than 501. A dataset with
exactly 501 observations falls through to the else branch and gets the
"fewer than 20 observations" NaN result, even though 500 and 502 both compute.
Repro: call get_vertical_equity_scores on a 501-row frame with valid sale and
valuation columns; vei is NaN. Repeat with 500 or 502 rows; it computes.
Minimal fix: elif observation_count > 500:.
Note: open PR #369 rewrites the qcut and tier logic in this same function. The
lines above are just outside that PR's hunks, but if #369 lands first this
one-character fix should be rebased onto its structure (or folded into it,
whichever the author prefers).
Line references below are to commit 7952236, in
openavmkit/vertical_equity_study.py.get_vertical_equity_scorespicks the quantile group count at lines 27-32:The branches cover 20 to 50, 51 to 500, and greater than 501. A dataset with
exactly 501 observations falls through to the else branch and gets the
"fewer than 20 observations" NaN result, even though 500 and 502 both compute.
Repro: call
get_vertical_equity_scoreson a 501-row frame with valid sale andvaluation columns;
veiis NaN. Repeat with 500 or 502 rows; it computes.Minimal fix:
elif observation_count > 500:.Note: open PR #369 rewrites the qcut and tier logic in this same function. The
lines above are just outside that PR's hunks, but if #369 lands first this
one-character fix should be rebased onto its structure (or folded into it,
whichever the author prefers).