Skip to content

Commit

Permalink
Continue revising the package
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed Apr 24, 2024
1 parent 27d5d06 commit bfbbe3b
Show file tree
Hide file tree
Showing 36 changed files with 3,270 additions and 1,472 deletions.
1 change: 1 addition & 0 deletions docs-source/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ REM Command file for Sphinx documentation
REM You can set these variables from the command line, and also
REM from the environment for the first two.
SET SPHINXOPTS=
SET SPHINXBUILD=sphinx-build
SET SOURCEDIR=source
SET LOCALBUILDDIR=build
SET GITHUBBUILDDIR=..\docs
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions prefsampling/approval/impartial.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ def impartial(
except ValueError:
pass
Validation
----------
We only validate the model with a single voter thus the distinction between individual and global does not
matter here. Call :math:`p` the probability of approving any candidate, then the probability of generating a
given approval ballot of size :math:`k` is:
.. math::
p^k \\times (1 - p)^{m - k},
where :math:`m` is the number of candidates.
References
----------
Expand Down Expand Up @@ -250,6 +262,15 @@ def impartial_constant_size(
except ValueError:
pass
Validation
----------
We only validate the model with a single voter thus the distinction between individual and global does not
matter here. For a given value of :code:`rel_num_approvals`, let
:math:`s = \\lfoor \\text{rel\\_num\\_approvals} \\times m \\rfloor` be the size of the approval ballots.
Then, the probability of generating a given approval ballot of size :math:`k` is 0 if :math:`k \neq s`,
and :math:`\\frac{1}{\\binom{m}{s}}` otherwise, where :math:`m` is the number of candidates.
References
----------
Expand Down
7 changes: 7 additions & 0 deletions prefsampling/approval/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class SetDistance(Enum):


class DistanceInfiniteError(ValueError):
"""
Exception thrown when the distance between two points is infinite., typically when dividing by 0 for the
Bunke-Shearer or the Jaccard distances.
"""

pass


Expand Down Expand Up @@ -94,6 +99,8 @@ def noise(
A collection of `num_voters` vote is generated independently and identically following the
process described above.
For an analogous sampler generating ordinal ballots, see :py:func:`~prefsampling.ordinal.mallows.mallows`.
Parameters
----------
num_voters : int
Expand Down
Loading

0 comments on commit bfbbe3b

Please sign in to comment.