subit_convergence: Subiterative Convergence

View source: R/subit_convergence.R

subit_convergenceR Documentation

Subiterative Convergence

Description

Subiterative Convergence finds the consensus ranking by iteratively applying the Modified Kemeny algorithm on smaller number of objects, \eta. Starting with a given seed ranking, the consensus ranking is obtained when the algorithm converges.

Usage

subit_convergence(
  eta,
  seed_rkg,
  input_rkgs,
  universe_rkgs = c(),
  objNames = c(),
  wt = c()
)

Arguments

eta

a subiteration length of number of objects to consider in the smaller subset. Recommended eta values are between 2 and 8. Smaller eta values result in shorter run-time.

seed_rkg

an initial ranking to start the algorithm. An ideal seed ranking for Subiterative Convergence is the mean seed ranking of input rankings.

input_rkgs

a n by k matrix of k rankings of n objects, where each column is a complete ranking.

universe_rkgs

a matrix containing all possible permutations of ranking n objects. Each column in this matrix represents one permuted ranking. An optional parameter.

objNames

a n-length vector containing object names. An optional parameter.

wt

a k-length vector containing weights for each judge or attribute. An optional parameter.

Value

A list containing the consensus ranking (expressed as ordering), total Kemeny distance, and average tau correlation coefficient corresponding to the consensus ranking.

References

Badal, P. S., & Das, A. (2018). Efficient algorithms using subiterative convergence for Kemeny ranking problem. Computers & Operations Research, 98, 198-210. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.cor.2018.06.007")}

See Also

mod_kemeny, fur, sigfur, mean_seed

Examples

## Four input rankings of five objects
eta <- 3
seed_rkg <- c(1, 2, 3, 4, 5)
input_rkgs <- matrix(c(3, 2, 5, 4, 1, 2, 3, 1, 5, 4, 5, 1, 3, 4, 2, 1, 2, 4, 5, 3),
    byrow = FALSE, ncol = 4)
subit_convergence(eta, seed_rkg, input_rkgs) # Determined the consensus ranking, total Kemeny
                                             # distance, and average tau correlation coefficient

## Example with eta=1
eta <- 1
seed_rkg <- c(1, 2, 3, 4, 5)
input_rkgs <- matrix(c(3, 2, 5, 4, 1, 2, 3, 1, 5, 4, 5, 1, 3, 4, 2, 1, 2, 4, 5, 3),
    byrow = FALSE, ncol = 4)
subit_convergence(eta, seed_rkg, input_rkgs) # Shows a warning and returns seed ranking

## Five input rankings with five objects
## 2nd ranking == 3rd ranking, so if a third object is weighted as zero,
## we should get the same answer as the first examples
input_rkgs <- matrix(c(3, 2, 5, 4, 1, 2, 3, 1, 5, 4, 2, 3, 1, 5, 4, 5, 1, 3, 4, 2, 1, 
                       2, 4, 5, 3),byrow = FALSE, ncol = 5)
eta <- 3
seed_rkg <- c(1, 2, 3, 4, 5)
wt = c(1,1,0,1,1)
subit_convergence(eta, seed_rkg, input_rkgs, wt=wt) # Determined the consensus ranking, total Kemeny
                                             # distance, and average tau correlation coefficient

## Using five input rankings with five objects with prepare_data to 
## automatically prepare the weight vector
input_rkgs <- matrix(c(3, 2, 5, 4, 1, 2, 3, 1, 5, 4, 2, 3, 1, 5, 4, 5, 1, 3, 4, 2, 1, 
                       2, 4, 5, 3),byrow = FALSE, ncol = 5)
out = prepare_data(input_rkgs) 
input_rkgs = out$input_rkgs
wt = out$wt
eta <- 3
seed_rkg <- c(1, 2, 3, 4, 5)
subit_convergence(eta, seed_rkg, input_rkgs, wt=wt) # Determined the consensus ranking, total Kemeny
                                             # distance, and average tau correlation coefficient

## Included dataset of 15 input rankings of 50 objects
data(data50x15)
input_rkgs <- as.matrix(data50x15[, -1])
mean_seed_rkg <- mean_seed(t(input_rkgs)) # Use the mean seed ranking as the seed ranking
eta <- 2
subit_convergence(eta, seed_rkg = mean_seed_rkg, input_rkgs)


RankAggSIgFUR documentation built on July 9, 2023, 7:26 p.m.