sample_posterior {elections.dtree}  R Documentation 
sample_posterior
draws sets of ballots from independent realizations
of the Dirichlettree posterior, then determines the probability for each
candidate being elected by aggregating the results of the social choice
function. See Everest et al. (2022) for
details.
sample_posterior(
dtree,
n_elections,
n_ballots,
n_winners = 1,
replace = FALSE,
n_threads = NULL
)
dtree 
A 
n_elections 
An integer representing the number of elections to generate. A higher number yields higher precision in the output probabilities. 
n_ballots 
An integer representing the total number of ballots cast in the election. 
n_winners 
The number of candidates elected in each election. 
replace 
A boolean indicating whether or not we should reuse the observed ballots in the montecarlo integration step to determine the posterior probabilities. 
n_threads 
The maximum number of threads for the process. The default value of

A numeric vector containing the probabilities for each candidate being elected.
Everest F, Blom M, Stark PB, Stuckey PJ, Teague V, Vukcevic D (2022). “BallotPolling Audits of InstantRunoff Voting Elections with a DirichletTree Model.” doi:10.48550/ARXIV.2209.03881..
Everest F, Blom M, Stark PB, Stuckey PJ, Teague V, Vukcevic D (2022). “Auditing Ranked Voting Elections with DirichletTree Models: First Steps.” doi:10.48550/ARXIV.2206.14605..