testFraction function

Bootstrapping experiment, with fractional counts of a ballot box.

Bootstrapping experiment, with fractional counts of a ballot box.

Starting from some number ('astart') of randomly-selected ballots, an increasingly-large collection of randomly-selected ballots are counted. The ballots are chosen independently without replacement for each experimental unit; if you want to count decreasingly-sized portions of a single sample of ballots, use testDeletions().

testFraction( votes = NULL, astart = NULL, ainc = NULL, arep = NULL, trep = NULL, rankMethod = "safeRank", countMethod = "stv", countArgs = list(), exptName = NULL, equiet = FALSE, everbose = FALSE )

Arguments

  • votes: A numeric matrix: one row per ballot, one column per candidate
  • astart: Starting number of ballots (min 2)
  • ainc: Number of ballots to be added in each step. Must be non-negative.
  • arep: Number of repetitions of the test on each step. Required to be non-'NULL' if 'ainc=0' && is.null(trep)'.
  • trep: Limit on the total number of simulated elections. Required to be non-'NULL' if 'ainc=0 && is.null(arep)'.
  • rankMethod: "safeRank" (default), "elected", or "rank". "rank" is a total ranking of the candidates, with ties broken at random. "elected" assigns rank=1 to elected candidates, rank=2 for eliminated candidates.
  • countMethod: countMethod "stv" (default) or "condorcet"
  • countArgs: List of args to be passed to 'countMethod' (in addition to 'votes')
  • exptName: stem-name of experimental units e.g. "E". If 'NULL', then a 3-character string of capital letters is chosen at random.
  • equiet: 'TRUE' to suppress all experimental output
  • everbose: 'TRUE' to produce diagnostic output from the experiment

Returns

SafeRankExpt object of experimental results.

Examples

data(food_election) testFraction(food_election, countMethod="condorcet", countArgs=list(safety=0.5,complete.ranking=TRUE)) testFraction(dublin_west, astart=20, ainc=10, arep=2, trep=3, countMethod="stv", rankMethod="elected", equiet=FALSE)
  • Maintainer: Clark Thomborson
  • License: GPL (>= 2)
  • Last published: 2024-10-05