bPlackettLuceModel: Bayesian Plackett-Luce model for ranking analysis

View source: R/bayesian.R

bPlackettLuceModelR Documentation

Bayesian Plackett-Luce model for ranking analysis

Description

Bayesian model based on the Plackett-Luce distribution over rankings to analyse multiple algorithms in multiple problems

Usage

bPlackettLuceModel(
  x.matrix,
  min = TRUE,
  prior = rep(1, ncol(x.matrix)),
  nsim = 2000,
  nchains = 8,
  parallel = TRUE,
  stan.output.file = NULL,
  seed = as.numeric(Sys.time()),
  ...
)

Arguments

x.matrix

Sample of performance of the algorithms. Each column is an algorithm and each row is a problem

min

Logical value indicating which values should be ranked in first postion. If TRUE, the smallest value will be the first ranked and if FALSE the first will be the one with the highest value

prior

Hyperparameters of the prior distribution of the weights. It should be a vector of size equal to the number of algorithms of real valued numbers greater than 0By default, all equal to 1

parallel

Logical value. If true, Stan code is executed in parallel

stan.output.file

String containing the base name for the output files produced by Stan. If NULL, no files are stored.

seed

Optional parameter used to fix the random seed

...

Additional arguments for the rstan::stan function that runs the analysis

nchain

Number of MC chains to be simulated. As half the simulations are used for the warm-up, the total number of simulations will be nchain*nsim/2

Value

A list with the following elements:

method

a string with the name of the method used

parameters

parameters used by the method

posterior.weights

a vector with the weights sampled from the posterior distribution

expected.win.prob

for each algorithm, the expected posterior probability of being the best

expceted.mode.rank

for each algorithm the expected rank in the most probable ranking

additional

complete results produced by the Stan program

Examples

n.alg  <- 5
n.inst <- 25
x.matrix <- matrix(runif(n.alg*n.inst), ncol=n.alg)
colnames(x.matrix) <- paste("Alg", 1:n.alg, sep="")
rownames(x.matrix) <- paste("Inst", 1:n.inst, sep="")

res <- bPlackettLuceModel(x.matrix, min=FALSE, nsim=2000, nchains=3)

res$expected.win.prob
res$expected.mode.rank

b0rxa/scmamp documentation built on Jan. 17, 2024, 10:49 a.m.