smari / voting

A simulator for voting systems.
27 stars 10 forks source link

Adjust beta parameters to stabilise probability distribution #64

Closed PeturOA closed 5 years ago

PeturOA commented 5 years ago

We are randomising the vote results around some base vote results, by introducing a variation in the vote results for each list. So, for each list, we want the random data to have a probability distribution with a mean identical to the starting value. Furthermore, we want the user to be able to control how much variation the probability distribution should have. To that effect, we provide an interface for an input parameter to influence the standard deviation.

As of yet, we have only implemented one method of generating the random vote results, using the Beta distribution as probability distribution. The Beta distribution takes two parameters, alpha and beta, which we prepare based on the given mean and desired standard deviation, indicated by the previously mentioned input parameter. We have restricted the value of the input parameter to ensure that alpha and beta can never be 0 (or less), but so far we have not been taking any precautions to ensure these parameters will not be less than 1.

But for our purposes, this is desirable, so this pull request is intended to fix that, to ensure that the alpha and beta parameters for the Beta distribution are no less than 1.

Furthermore, the above mentioned input parameter can not alone control the variation, because the mean must also be taken into account. Nevertheless, we have, until now, been thinking about this parameter as if it controls the standard deviation directly, which is a little misleading.

So I propose that we replace the parameter with a related parameter, a kind of inversion of the previous one, which can be interpreted as a kind of stability parameter. It would be restricted to values no less than 1, and the higher the value, the more stability and less variation (the generated random votes will be centred more tightly around the given mean)