View source: R/compute_consensus.R
compute_consensus.SMCMallows | R Documentation |
Compute the consensus ranking using either cumulative probability (CP) or maximum a posteriori (MAP) consensus \insertCitevitelli2018BayesMallows. For mixture models, the consensus is given for each mixture.
## S3 method for class 'SMCMallows'
compute_consensus(model_fit, type = "CP", ...)
model_fit |
An object of class |
type |
Character string specifying which consensus to compute. Either
|
... |
Other optional arguments passed to methods. Currently not used. |
Other posterior quantities:
assign_cluster()
,
compute_consensus.BayesMallows()
,
compute_consensus()
,
compute_posterior_intervals.BayesMallows()
,
compute_posterior_intervals.SMCMallows()
,
compute_posterior_intervals()
,
heat_plot()
,
plot.BayesMallows()
,
plot.SMCMallows()
,
plot_elbow()
,
plot_top_k()
,
predict_top_k()
,
print.BayesMallowsMixtures()
,
print.BayesMallows()
# Basic elements
data <- sushi_rankings[1:100, ]
n_items <- ncol(data)
leap_size <- floor(n_items / 5)
metric <- "footrule"
Time <- 20
N <- 100
# Prepare exact partition function
cardinalities <- prepare_partition_function(metric = metric,
n_items = n_items)$cardinalities
# Performing SMC
smc_test <- smc_mallows_new_users(
R_obs = data, type = "complete", n_items = n_items,
metric = metric, leap_size = leap_size,
N = N, Time = Time,
cardinalities = cardinalities,
mcmc_kernel_app = 5,
num_new_obs = 5,
alpha_prop_sd = 0.5,
lambda = 0.15,
alpha_max = 1e6
)
compute_posterior_intervals(smc_test, parameter = "rho")
compute_consensus(model_fit = smc_test, type = "CP")
compute_consensus(model_fit = smc_test, type = "MAP")
compute_posterior_intervals(smc_test, parameter = "alpha")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.