Worker function for computing the posterior distribution.
run_mcmc(
rankings,
obs_freq,
nmc,
constraints,
cardinalities,
logz_estimate,
rho_init,
metric = "footrule",
error_model = "none",
Lswap = 1L,
n_clusters = 1L,
include_wcd = FALSE,
leap_size = 1L,
alpha_prop_sd = 0.5,
alpha_init = 5,
alpha_jump = 1L,
lambda = 0.1,
alpha_max = 1e+06,
psi = 10L,
rho_thinning = 1L,
aug_thinning = 1L,
clus_thin = 1L,
save_aug = FALSE,
verbose = FALSE,
kappa_1 = 1,
kappa_2 = 1,
save_ind_clus = FALSE
)
A set of complete rankings, with one sample per column. With n_assessors samples and n_items items, rankings is n_items x n_assessors.
A vector of observation frequencies (weights) to apply to the rankings.
Number of Monte Carlo samples.
List of lists of lists, returned from `generate_constraints`.
Used when metric equals "footrule"
or
"spearman"
for computing the partition function. Defaults to
R_NilValue
.
Estimate of the log partition function.
The distance metric to use. One of "spearman"
,
"footrule"
, "kendall"
, "cayley"
, or
"hamming"
.
Error model to use.
Swap parameter used by Swap proposal for proposing rank augmentations in the case of non-transitive pairwise comparisons.
Number of clusters. Defaults to 1.
Boolean defining whether or not to store the within-cluster distance.
Leap-and-shift step size.
Standard deviation of proposal distribution for alpha.
Initial value of alpha.
How many times should we sample rho
between
each time we sample alpha
. Setting alpha_jump
to a high
number can significantly speed up computation time, since we then do not
have to do expensive computation of the partition function.
Parameter of the prior distribution.
Maximum value of alpha
, used for truncating the exponential prior distribution.
Hyperparameter for the Dirichlet prior distribution used in clustering.
Thinning parameter. Keep only every rho_thinning
rank
sample from the posterior distribution.
Integer specifying the thinning for data augmentation.
Integer specifying the thinning for saving cluster assignments.
Whether or not to save the augmented data every
aug_thinning
th iteration.
Logical specifying whether to print out the progress of the
Metropolis-Hastings algorithm. If TRUE
, a notification is printed every
1000th iteration.
Hyperparameter for \(theta\) in the Bernoulli error model. Defaults to 1.0.
Hyperparameter for \(theta\) in the Bernoulli error model. Defaults to 1.0.
Whether or not to save the individual cluster probabilities in each step,
thinned as specified in argument clus_thin
. This results in csv files cluster_probs1.csv
,
cluster_probs2.csv
, ..., being saved in the calling directory. This option may slow down the code
considerably, but is necessary for detecting label switching using Stephen's algorithm.