# \donttest{
# Example 1: Using an 'eim' object directly
simulations <- simulate_election(
num_ballots = 200,
num_candidates = 5,
num_groups = 3,
)
model <- eim(X = simulations$X, W = simulations$W)
model <- bootstrap(
object = model,
nboot = 30,
method = "mult",
maxiter = 500,
verbose = FALSE,
)
# Access standard deviation throughout 'model'
print(model$sd)
# Example 2: Providing 'X' and 'W' matrices directly
model <- bootstrap(
X = simulations$X,
W = simulations$W,
nboot = 15,
method = "mvn_pdf",
maxiter = 100,
maxtime = 5,
param_threshold = 0.01,
allow_mismatch = FALSE
)
print(model$sd)
# }
# Example 3: Using a JSON file as input
if (FALSE) {
model <- bootstrap(
json_path = "path/to/election_data.json",
nboot = 70,
method = "mult",
)
print(model$sd)
}
Run the code above in your browser using DataLab