generate_dirichlet {voteSim}R Documentation

Generate multinomial scores

Description

This function generates scores following a Dirichlet distribution

Usage

generate_dirichlet(n_voters, n_candidates, probs = 0)

Arguments

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.

Value

A matrix of scores with 'n_candidates' rows and 'n_voters' columns.

Examples

voting_situation <- generate_dirichlet(n_voters=10, n_candidates=3,  probs=c(0.5, 0.3, 0.2))

[Package voteSim version 0.1.1 Index]