sim.race | R Documentation |
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.
sim.race( n = 800, beta = 0.75, stages = 2, truth.maker = make.truth.opt.bad, print.trail = FALSE )
n |
Desired sample size. |
beta |
the confidence level desired |
stages |
number of auditing stages. Each stage will have the same confidence level, determined by a function of beta. |
truth.maker |
Function to generate "truth" |
print.trail |
Print out diagnostics. |
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.
See CAST.audit
and CAST.calc.opt.cut
for
methods regarding CAST audits. Also see do.audit
,
make.sample
, and make.truth
for doing other
simulation studies of this method.
## 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) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.