Description Usage Arguments Value Examples
This function estimates a finite mixture model of election fraud
1 2 3 4 5 |
formula1 |
an object of the class |
formula2 |
an object of the class |
formula3 |
See description below |
formula4 |
See description below |
formula5 |
See description below |
formula6 |
See description below
|
data |
a dara.frame with the independent variables (voters for the winner and abstention) and the covariates. If the independent variables are counts, the it is necessary to provide the total number of elegible voters (see parameter |
elegible.voters |
string with the name of the variable in the data that contains the number of elegible voters. Default is |
weights |
(not used) |
mcmc |
a list containing |
model |
a string with the model ID to use in the estimation. Run |
parameters |
a string vector with the names of the parameters to monitor. When |
na.action |
(not used) |
get.dic |
logical. If get.dic is FALSE, no DIC is calculated. If get.dic is an integer greater than 0, run model get.dic iterations to get the DIC. If |
parComp |
Logical. If parComp = TRUE, then chains are computed in parallel using the runjags architecture. This opens n.chains instances of JAGS. In practice, a max of 4 unique chains can be run due to the way in which JAGS generates initial values. |
autoConv |
Logical. If parComp = TRUE and autoConv = TRUE, the chains are run until convergence criteria are met. Currently, chains are run for a single period equal to |
max.auto |
Integer. Number of subsequent tries to achieve a PSRF of 1.05 on pi. After |
The function returns a nested list. The first element of the list is a mcmc
object with the samples from the posterior distribution. The second element of the list is a list of summaries (HPD, Mean, etc)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | model = 'bl'
## simulate data
## -------------
sim_data = ef_simulateData(n=700, nCov=1, model=model)
data = sim_data$data
## mcmc parameters
## ---------------
mcmc = list(burn.in=1, n.adapt=10, n.iter=100, n.chains=2)
## samples
## -------
## help(eforensics)
devtools::document(pkg_folder)
samples = eforensics(
w ~ x1.w ,
a ~ x1.a,
mu.iota.m ~ x1.iota.m,
mu.iota.s ~ x1.iota.s,
## mu.chi.m ~ x1.chi.m,
## mu.chi.s ~ x1.chi.s,
data=data,
elegible.voters="N",
model=model, mcmc=mcmc, get.dic=0)
summary(samples)
summary(samples, join.chains=T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.