Learn R Programming

elections.dtree (version 2.0.0)

sample_predictive: Draw ballots from the posterior predictive distribution.

Description

sample_predictive draws ballots from a multinomial distribution with probabilities obtained from a single realization of the Dirichlet-tree posterior on the ranked ballots. See dtree_evoteid;textualelections.dtree for details.

Usage

sample_predictive(dtree, n_ballots)

Value

A prefio::preferences object containing n_ballots

ballots drawn from a single realisation of the posterior Dirichlet-tree.

Arguments

dtree

A dirichlet_tree object.

n_ballots

An integer representing the number of ballots to draw.

References

dtree_eiselections.dtree.

dtree_evoteidelections.dtree.