generate_dirichlet | R Documentation |
This function generates scores following a Dirichlet distribution
generate_dirichlet(n_voters, n_candidates, probs = 0)
n_voters |
integer, the number of voters to generate scores for. |
n_candidates |
integer, The number of candidates to generate scores for. |
probs |
A vector of size n_candidates corresponding to the parameters of the Dirichlet distribution. By default all values are equal to 1. |
A matrix of scores with 'n_candidates' rows and 'n_voters' columns.
voting_situation <- generate_dirichlet(n_voters=10, n_candidates=3, probs=c(0.5, 0.3, 0.2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.