Draw election outcomes from the posterior distribution.Source:
sample_posterior draws sets of ballots from independent realizations
of the Dirichlet-tree posterior, then determines the probability for each
candidate being elected by aggregating the results of the social choice
function. See Everest et al. (2022)
sample_posterior( dtree, n_elections, n_ballots, n_winners = 1, replace = FALSE, n_threads = NULL )
An integer representing the number of elections to generate. A higher number yields higher precision in the output probabilities.
An integer representing the total number of ballots cast in the election.
The number of candidates elected in each election.
A boolean indicating whether or not we should re-use the observed ballots in the monte-carlo integration step to determine the posterior probabilities.
The maximum number of threads for the process. The default value of
NULLwill default to 2 threads.
Infwill default to the maximum available, and any value greater than or equal to the maximum available will result in the maximum available.
Everest F, Blom M, Stark PB, Stuckey PJ, Teague V, Vukcevic D (2023). “Ballot-Polling Audits of Instant-Runoff Voting Elections with a Dirichlet-Tree Model.” In Computer Security. ESORICS 2022 International Workshops, 525--540. ISBN 978-3-031-25460-4. .
Everest F, Blom M, Stark PB, Stuckey PJ, Teague V, Vukcevic D (2022). “Auditing Ranked Voting Elections with Dirichlet-Tree Models: First Steps.” doi:10.15157/diss/021 . .