dirtree: Create a Dirichlet-tree object

View source: R/dtree.R

dirtreeR Documentation

Create a Dirichlet-tree object

Description

dirtree is used to create a Dirichlet-tree for modelling ballots, as described by \insertCitedtree_evoteid;textualelections.dtree.

Usage

dirtree(
  candidates,
  min_depth = 0,
  max_depth = length(candidates),
  a0 = 1,
  vd = FALSE
)

Arguments

candidates

A character vector, with each element (must be unique) representing a single candidate.

min_depth

The minimum number of candidates which must be specified for a valid ballot.

max_depth

The maximum number of candidates which can be specified for a valid ballot.

a0

The prior parameter for the distribution.

vd

A flag which, when TRUE, employs a parameter structure which reduces to a regular Dirichlet distribution as described by \insertCitedtree_evoteid;textualelections.dtree.

Value

A Dirichlet-tree representing ranked ballots, as an object of class dirichlet_tree.

References

\insertRef

dtree_eiselections.dtree.

\insertRef

dtree_evoteidelections.dtree.


elections.dtree documentation built on Sept. 16, 2023, 5:06 p.m.