EI Bayesian simultaneous estimation for multiple races and candidates
ei_rxc(
data,
cand_cols,
race_cols,
totals_col,
name = "",
ntunes = 10,
totaldraws = 10000,
samples = 1e+05,
thin = 1,
burnin = 10000,
ci_size = 0.95,
seed = NULL,
eiCompare_class = TRUE,
ret_mcmc = FALSE,
verbose = FALSE,
diagnostic = FALSE,
n_chains = 3,
plot_path = NULL,
par_compute = FALSE,
n_cores = NULL,
...
)
If ret_mcmc == TRUE, a list is returned containing results and a data frame of the full chains from the MCMC. If ret_mcmc == FALSE, results are returned in a dataframe
A dataframe of ei results
A data.frame() object containing precinct-level turnout data by race and candidate
A character vector listing the column names for turnout for each candidate
A character vector listing the column names for turnout by race
The name of the column containing total votes cast in each precinct
A unique identifier for the outputted eiCompare object.
Integer number of pre-MCMC tuning runs, defaulted to 10
Integer number of iterations per run in pre-MCMC tuning runs, defaulted to 10000
Integer number of draws saved and used to compute estimates. Total chain length is sample*thin + burnin
Integer specifying the thinning interval for posterior draws. Eg. if thin = 2, every second draw gets added to the sample
Integery specifying the number of initial iterations to be discarded, defaulted to 10000
Numeric desired probability within the upper and lower credible-interval bounds, defaulted to 0.95
A numeric seed value for replicating estimate results across runs. If NULL, a random seed is chosen. Defaulted to NULL.
default = TRUE
Boolean. If true, the full sample chains are returned
A boolean indicating whether to print out status messages.
Boolean. If true, run diagnostic test to assess viability of MCMC parameters (will return all chain results)
Number of chains for diagnostic test. Default is set to 3.
A string to specify plot save location. If NULL, plot is not saved.
Boolean. If true, diagnostic test will be run in parallel.
The number of cores to use in parallel computation. Defaulted to NULL, in which case parallel::detectCores() - 1 is used
Additional parameters passed to eiPack::tuneMD()
Loren Collingwood <loren.collingwood@ucr.edu>, <loren.collingwood@gmail.com>
Hikari Murayama <hikari_murayama@berkeley.edu>
Ari Decter-Frain <agd75@cornell.edu>
eiPack, King et al., (http://gking.harvard.edu/eiR)