This function implements a reversible jump MCMC procedure for updating the parameter partition in Bayesian Rank-Clustered BTL models. For internal use only.

sample_partition(
  Pi,
  I,
  J,
  nu,
  g,
  K,
  a_gamma,
  b_gamma,
  logprior_partition,
  b_g = 0.5,
  d_g = 0.5,
  groupwise = FALSE
)

Arguments

Pi

A matrix of preference orderings ("rankings"), such that the (i,j) entry is the index of the jth-most preferred object according to judge i. If groupwise=TRUE, then the index corresponds to the jth-most preferred object among those in row i; if groupwise=FALSE, it is assumed that all unranked objects (if any) are less preferred than those which are ranked.

I

A numeric indicating the number of rows in Pi

J

A numeric indicating the total number of objects being compared.

nu

A vector indicating current values for nu in the Gibbs sampler.

g

A vector indicating current values for g in the Gibbs sampler.

K

A vector indicating current values for K in the Gibbs sampler.

a_gamma

A numeric for the first hyperparameter (shape) in a Gamma prior on each worth parameter.

b_gamma

A numeric for the second hyperparameter (rate) in a Gamma prior on each worth parameter.

logprior_partition

A J-vector indicating the log unnormalized probability for each possible partition, based on its number of non-empty clusters.

b_g

The probability of "birth"ing a new partition cluster, if possible.

d_g

The probability of "death"ing an existing partition cluster, if possible.

groupwise

A boolean to indicate whether the observed rankings are complete/partial rankings (FALSE; default) or groupwise comparisons (TRUE).

Value

A list containing updated values for g, nu, and K.