- class svvamp.GeneratorProfileGaussianWell(n_v, n_c, sigma, shift=None, sort_voters=False)[source]
Profile generator using the ‘Gaussian well’ model.
- Parameters:
n_v (int) – Number of voters.
n_c (int) – Number of candidates.
sigma (list or ndarray) – 1d array of numbers. The variance of the gaussian distribution along each dimension.
shift (list or ndarray) – 1d array of numbers, same dimension as
sigma
. Shift for the mean position of the candidates.sort_voters (bool) – This argument is passed to
Profile
.
Notes
Let us note
n_dim
the number of elements insigma
. For voterv
(resp. each candidatec
) and each axisi
inrange(n_dim)
, a positionx_i[v]
(resp.y_i[c]
) is independently drawn according to a normal distribution of mean 0 and variancesigma[i]
. Ifshift
is used, the distribution of positions for candidates is displaced by this vector.Let
d[v, c]
denote the Euclidean distance between voterv
’s positionx[v]
and candidatec
’s positiony[c]
. Thenpreferences_ut[v, c] = A - d[v, c]
, whereA
is such that the average utility is 0 over the whole population.Remark: if
n_dim = 1
, the population is single-peaked.Examples
>>> generator = GeneratorProfileGaussianWell(n_v=10, n_c=3, sigma=[1], shift=[10]) >>> profile = generator() >>> profile.preferences_rk.shape (10, 3)