## Example 1. Compute the bootstrap 95% confidence intervals for the Antifragility dataset.
# Let us assume no clusters.
r_antifrag <- ranks_antifragility[, 1:7]
set.seed(12345)
fit <- fitMSmix(rankings = r_antifrag, n_clust = 1, n_start = 1)
# Apply non-parametric bootstrap procedure.
set.seed(12345)
boot_np <- bootstrapMSmix(object = fit, n_boot = 200)
print(boot_np)
# Apply parametric bootstrap procedure and set all = TRUE
# to return the bootstrap MLEs of the consensus ranking.
set.seed(12345)
boot_p <- bootstrapMSmix(object = fit, n_boot = 200,
type = "parametric", all = TRUE)
print(boot_p)
# Plot the bootstrap estimates.
p_boot_p <- plot(boot_p)
p_boot_p$rho_heatmap()
p_boot_p$theta_density()
## Example 2. Compute the bootstrap 95% confidence intervals for the Antifragility dataset.
# Let us assume two clusters.
r_antifrag <- ranks_antifragility[, 1:7]
set.seed(12345)
fit <- fitMSmix(rankings = r_antifrag, n_clust = 2, n_start = 20)
# Apply soft bootstrap procedure and set all = TRUE
# to return the bootstrap MLEs of the consensus ranking.
set.seed(12345)
boot_soft <- bootstrapMSmix(object = fit, n_boot = 500,
n_start = 20, all = TRUE)
print(boot_soft)
# Plot the bootstrap estimates.
p_boot_soft <- plot(boot_soft)
p_boot_soft$rho_heatmap[[1]]()
p_boot_soft$rho_heatmap[[2]]()
p_boot_soft$theta_density()
p_boot_soft$weights_density()
# Apply separated bootstrap and compare results.
set.seed(12345)
boot_sep <- bootstrapMSmix(object = fit, n_boot = 500,
n_start = 20, type = "separated", all = TRUE)
print(boot_sep)
p_boot_sep <- plot(boot_sep)
p_boot_sep$rho_heatmap[[1]]()
p_boot_sep$rho_heatmap[[2]]()
p_boot_sep$theta_density()
print(boot_soft)
print(boot_sep)
Run the code above in your browser using DataLab