generate_multinom {voteSim}R Documentation

Generate multinomial scores

Description

This function generates discrete scores following a multinomial distribution on a given scale

Usage

generate_multinom(n_voters, n_candidates, max = 10, 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.

max

The maximum value of the distribution, by default 10. It also corresponds to the sum of scores on all the candidates

probs

A vector of size n_candidates corresponding to the parameters of the multinomial distribution. By default all values are equal to 1/n_candidates

Value

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

Examples

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

[Package voteSim version 0.1.1 Index]