From a7db4a032547511a65acfc073727bc65c7743d46 Mon Sep 17 00:00:00 2001 From: Eric Pacuit Date: Wed, 5 Feb 2025 05:37:03 -0500 Subject: [PATCH] add citation to JOSS paper --- docs/source/index.rst | 25 +++++++++++++++++++++++++ pref_voting/utility_functions.py | 7 ++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index e90c39d..8e7f4a3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -21,6 +21,31 @@ The library is developed by Wes Holliday (http://wesholliday.net) and Eric Pacui Related resources ------------------------ +If you would like to acknowledge our work in a scientific paper, +please use the following citation: + +Wesley H. Holliday and Eric Pacuit (2025). pref_voting: The Preferential Voting Tools package for Python. Journal of Open Source Software, 10(105), 7020. https://doi.org/10.21105/joss.07020 + +**Bibtex***: + +```bibtex +@article{HollidayPacuit2025, + author = {Wesley H. Holliday and Eric Pacuit}, + title = {pref_voting: The Preferential Voting Tools package for Python}, + journal = {Journal of Open Source Software}, + year = {2025}, + publisher = {The Open Journal}, + volume = {10}, + number = {105}, + pages = {7020}, + doi = {10.21105/joss.07020} +} + +``` + +Related resources +------------------------ + - VoteKit (https://votekit.readthedocs.io/) - A Python package developed by the MGGG Redistricting Lab (https://mggg.org/) designed to facilitate the study of different election methods. - prefsampling (https://comsoc-community.github.io/prefsampling/) - A Python library for sampling from preference profiles with respect to different probability models. diff --git a/pref_voting/utility_functions.py b/pref_voting/utility_functions.py index 774b821..f812aa4 100644 --- a/pref_voting/utility_functions.py +++ b/pref_voting/utility_functions.py @@ -71,18 +71,19 @@ def city_block_utility(v_pos: float32[:], c_pos: float32[:]): return -distance.cityblock(v_pos, c_pos) @jit(nopython=True, fastmath=True) -def shepsle_utility(v_pos: float32[:], c_pos: float32[:]): +def shepsle_utility(v_pos: float32[:], c_pos: float32[:], kappa: float32 = 1): """ The Shepsle utility function from "The Strategy of Ambiguity: Uncertainty and Electoral Competition" by Kenneth A. Shepsle, American Political Science Review, 1972, vol. 66, issue 2, pp. 555-568. For a justification of this utility function, see Appendix B from *Making Multicandidate Elections More Democratic* (https://doi.org/10.1515/9781400859504.114) by S. Merrill III. Args: v_pos (numpy array): The position(s) of the voter. - c_pos (numpy array): The position(s) of the candidate. + c_pos (numpy array): The position(s) of the candidate. + kappa (float): A parameter that determines the steepness of the utility function. Returns: float: The utility of the candidate to the voter. """ d = np.linalg.norm(v_pos - c_pos) - return np.exp(-d**2 / 2) + return np.exp((kappa**2 * -d**2) / 2) @jit(nopython=True, fastmath=True)