- class svvamp.GeneratorProfileIanc(n_v, n_c, sort_voters=False)[source]
Profile generator: Impartial, Anonymous and Neutral Culture.
Cf. Eğecioğlu, Ömer & Giritligil, Ayça E. (2013). The impartial, anonymous, and neutral culture model: a probability model for sampling public preference structures. The Journal of mathematical sociology, 37(4), 203-222.
The code is adapted from:
A Mathematica program by Ömer Eğecioğlu: https://sites.cs.ucsb.edu/~omer/randomvote.nb.
The Python function accel_asc by Jerome Kelleher: https://jeromekelleher.net/generating-integer-partitions.html.
- Parameters:
n_v (int) – Number of voters.
n_c (int) – Number of candidates.
sort_voters (bool) – This argument is passed to
Profile
.
Examples
>>> np.random.seed(42) >>> generator = GeneratorProfileIanc(n_v=10, n_c=3) >>> profile = generator() >>> profile.preferences_rk.shape (10, 3)