powered by
This function generates scores following a Dirichlet distribution
generate_dirichlet(n_voters, n_candidates, probs = 0)
A matrix of scores with 'n_candidates' rows and 'n_voters' columns.
integer, the number of voters to generate scores for.
integer, The number of candidates to generate scores for.
A vector of size n_candidates corresponding to the parameters of the Dirichlet distribution. By default all values are equal to 1.
voting_situation <- generate_dirichlet(n_voters=10, n_candidates=3, probs=c(0.5, 0.3, 0.2))
Run the code above in your browser using DataLab