Fix winner distribution plots: center on voter median (#22)#45
Fix winner distribution plots: center on voter median (#22)#45endolith wants to merge 3 commits into
Conversation
Benchmarks and histograms used the coordinate origin for "nearest center", which misaligned Condorcet-style outcomes with the reference ideal. Record winner locations minus the sample voter median and define the ideal winner as the candidate closest to that median (issue #22). Figure 3 reproduction anchors the uniform draws to the voter median like the other examples. Co-authored-by: endolith <endolith@gmail.com>
PR Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45 +/- ##
=======================================
Coverage 96.31% 96.31%
=======================================
Files 19 19
Lines 489 489
=======================================
Hits 471 471
Misses 18 18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Revert issue #22 coordinate centering for Merrill-style distributions_by_* scripts. Keep median-centered winners and ideal benchmark in tomlinson_2023_figure_3_updated.py; restore tomlinson_2023_figure_3.py to mean anchoring for paper reproduction. Co-authored-by: endolith <endolith@gmail.com>
Use one median ref for both voter and candidate uniforms on [0, 1] so distances match the raw draw; drop incorrect Merrill mention in the updated example comment. Co-authored-by: endolith <endolith@gmail.com>
Summary
tomlinson_2023_figure_3_updated.py: Winner positions minus voter median per election; ideal = candidate nearest that median (issue Remove discrepancy from winner distribution plots #22).tomlinson_2023_figure_3.py: Same anchoring idea for the Figure 3 reproduction: one voter-sample medianreftranslates both uniform draws on ([0,1]) so distances are unchanged but the realized median sits at 0.5 (consistent with the updated script).distributions_by_*: Unchanged frommaster(no issue Remove discrepancy from winner distribution plots #22 centering there).Closes #22.
Testing
python3 -m pytest tests/ -q(191 passed)