Description Usage Arguments Details Value See Also
The functions calibration_party
and calibration_prop
perform
simulation from past election results, fit a model calling
(mrp_party_estimation
or mrp_estimation
) for each
simulation and return posterior simulations along actual outcomes, these can
later be used to compute calibration summaries with the corresponding
function: summary_calibration_party
or summary_calibration
.
calibration_party
is useful to calibrate individual models of total
votes for a given party and calibration_prop
is useful to analyse
estimates for proportion of votes per party.
1 2 3 4 5 6 7 8 9 10 11 | calibration_party(data, party, stratum, frac = 1, n_iter = 2000,
n_burnin = 500, n_chains = 3, seed = NA, cl_cores = 14, n_rep = 5,
model_string = NULL)
calibration_prop(data, ..., stratum, frac = 1, n_iter = 2000,
n_burnin = 500, n_chains = 3, seed = NA, cl_cores = 3, n_rep = 5,
model_string = NULL, num_missing_strata = 0)
summary_calibration_party(calib_run_party, alpha_r = 0.05)
summary_calibration(calib_run, alpha_r = 0.05)
|
data |
A |
party |
Unquoted variable indicating the column from the data.frame to be modeled. |
stratum |
If sampling the data, unquoted variable indicating the column from the data.frame to be used as strata. The strata will also be used in the hierarchical structure of the model. |
frac |
If sampling the data, numeric value indicating the fraction of the data to sample, the sample is selected using stratified sampling with probability proportional to size. |
n_iter |
Number of iterations, burnin size and chains.
to be used in |
n_burnin |
Number of iterations, burnin size and chains.
to be used in |
n_chains |
Number of iterations, burnin size and chains.
to be used in |
seed |
An integer vector of length 7 to be send to
|
cl_cores |
Number of cores, parameter is used in
|
n_rep |
Number of repetitions of sample selection and model fitting. |
model_string |
String indicating the model to fit. |
alpha_r |
Calibration examines coverage of (1-alpha_r)*100 intervals. |
The functions are computationally demanding, they were designed to run on computers with more than 16 cores.
data.frame
with posterior simulation of total votes (if using
calibration_party
) or proportions (if using calibration_prop
)
for each repetiton of sample selection and model fitting.
mrp_estimation
, mrp_party_estimation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.