Simulate CAST audits to assess performance
Simulate a race (using the
make.cartoon method) and run a CAST audit on that simulation.
CAST is a system devised by Dr. Philip B., Stark, UC
Berkeley Department of Statistics.
1 2 3
the confidence level desired
number of auditing stages. Each stage will have the same confidence level, determined by a function of beta.
Print out diagnostics.
Desired sample size.
Function to generate "truth"
A vector of 3 numbers. The first is the stage reached. The second is the total number of precincts audited. The third is 0 if the audit failed to certify (i.e. found large error in the final stage), and 1 if the audit certified the election (did not find large error in the final stage).
Luke W. Miratrix
See http://www.stat.berkeley.edu/~stark/Vote/index.htm for relevant information.
CAST.calc.opt.cut for methods regarding CAST audits.
make.truth for doing other simulation studies of this method.
1 2 3 4 5 6
## See how many times the CAST method fails to catch a wrong ## election in 20 trials. replicate( 20, sim.race( beta=0.75, stages=2, truth.maker=make.truth.opt.bad) ) ## Now see how much work the CAST method does for typical elections. replicate( 20, sim.race( beta=0.75, stages=2, truth.maker=make.ok.truth) )
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.