Package 'raincin'

Title: Ranking with Incomplete Information
Description: Various statistical and mathematical ranking and rating methods with incomplete information are included. This package is initially designed for the scoring system in a high school project showcase to rank student research projects, where each judge can only evaluate a set of projects in a limited time period. See Langville, A. N. and Meyer, C. D. (2012), Who is Number 1: The Science of Rating and Ranking, Princeton University Press <doi:10.1515/9781400841677>, and Gou, J. and Wu, S. (2020), A Judging System for Project Showcase: Rating and Ranking with Incomplete Information, Technical Report.
Authors: Jiangtao Gou [aut, cre], Fengqing Zhang [aut], Shuyi Wu [aut]
Maintainer: Jiangtao Gou <[email protected]>
License: GPL-3
Version: 1.0.3
Built: 2024-12-23 06:36:31 UTC
Source: CRAN

Help Index


Colley’s Method for Rating and Ranking

Description

Calculate ratings and provide rankings using Colley’s method

Usage

colley(jpMat, method = "colley", ties.method = "average")

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying Colley's method, including "colley", "colleym", "colleynt" and "colleymnt"

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

  1. colley: Colley's method

  2. colleym: Colleyized Massey method

  3. colleynt: Colley's method, no ties

  4. colleymnt: Colleyized Massey method, no ties

Value

A list of two vectors: a rating vector and a ranking vector

Author(s)

Jiangtao Gou

References

Colley, W. N. (2001). Colley's bias free college football ranking method: the Colley matrix explained.

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4), 
nrow=6, 
byrow=TRUE)
result <- colley(jpMat, method='colley')
print(result)

Judge-Presenter Matrix Converter

Description

Convert a judge-presenter matrix to a data frame with three variables/columns

Usage

convertJudgePresenterMatrix(jpMat)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

Details

  1. score: nonzero and non-NA scores

  2. row: array indices

  3. col: arry indices

Value

A data frame as a long table, where each row is an observation, including the score, the row number and the column number in the jpMat matrix

Author(s)

Jiangtao Gou

Fengqing Zhang

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- convertJudgePresenterMatrix(jpMat)
print(result)

Elo’s Method for Rating and Ranking

Description

Calculate ratings and provide rankings using Elo's system

Usage

elo(
  jpMat,
  method = "elow",
  Kfactor = 32,
  xiparameter = 400,
  initScore = 2000,
  round = 100,
  ties.method = "average"
)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying Elo's method, including "elo", "elow", "elos"

Kfactor

a parameter to properly balance the deviation between actual and expected scroes against prior ratings

xiparameter

a parameter affects the spread of the reatings in the logistic function

initScore

a parameter describe the average rating

round

a parameter indicates the number of iterations

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

  1. elo: Elo's system, using win-tie-loss, equivalent to elow

  2. elow: Elo's system, using win-tie-loss

  3. elos: Elo's system, using game scores (each pair has one pair of scores)

Author(s)

Jiangtao Gou

References

Elo, A. E. (1978). The Rating of Chessplayers, Past and Present. Arco Publishing Company, New York.

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- elo(jpMat, 
method='elow', 
Kfactor=32, 
xiparameter=400, 
initScore=2000, 
round=10, 
ties.method='average')
print(result)

Keener's method for Rating and Ranking

Description

Calculate ratings and provide rankings using Keener's method, without using Laplace's Rule of Succession, and using Laplace's Rule of Succession

Usage

keener(
  jpMat,
  method = "keener",
  irreducibility = 0.01,
  ties.method = "average"
)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying Keener's method without applying a nonlinear skweing function, including "keener", "keenerwolrs"

irreducibility

a non-negative parameter, which is the ratio of the value of each element in the pertubation matrix to the average value in the normalized proportaion matrix.

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

  1. keener: Keener's method with Laplace's Rule of Succession

  2. keenerwolrs: Keener's method without Laplace's Rule of Succession

  1. hitsjp: HITS, using judge-presenter matrix, equivalent to offdefsc

  2. offdefnt: Offense-Defense rating method, using judge-presenter matrix

Author(s)

Jiangtao Gou

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Keener, J. P. (1993). The Perron-Frobenius theorem and the ranking of football teams. SIAM Review 35, 80-93.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

library(popdemo)
jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- keener(jpMat,
method = 'keener',
irreducibility = 0)
print(result)

Keener's method applying a nonlinear skweing function for Rating and Ranking

Description

Calculate ratings and provide rankings using Keener's method applying a nonlinear skweing function, without using Laplace's Rule of Succession, and using Laplace's Rule of Succession

Usage

keenersk(
  jpMat,
  method = "keenersk",
  irreducibility = 0.01,
  ties.method = "average"
)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying Keener's method applying a nonlinear skweing function, including "keenersk", "keenerskwolrs"

irreducibility

a non-negative parameter, which is the ratio of the value of each element in the pertubation matrix to the average value in the normalized proportaion matrix.

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

  1. keenersk: Keener's method with Laplace's Rule of Succession, applying a nonlinear skweing function

  2. keenerskwolrs: Keener's method without Laplace's Rule of Succession, applying a nonlinear skweing function

Author(s)

Jiangtao Gou

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Keener, J. P. (1993). The Perron-Frobenius theorem and the ranking of football teams. SIAM Review 35, 80-93.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

library(popdemo)
jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- keenersk(jpMat,
method = 'keenersk',
irreducibility = 0)
print(result)

Google's PageRank algorithm for Rating and Ranking

Description

Calculate ratings and provide rankings using Google's PageRank algorithm

Usage

markov(
  jpMat,
  method = "markovvl",
  dampingFactor = 0.85,
  ties.method = "average"
)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying Markov's method, including "markov", "markovvl", "markovlvpd", "markovwlvp".

dampingFactor

the PageRank theory holds that an imaginary surfer who is randomly clicking on links will eventually stop clicking. The probability, at any step, that the person will continue is a damping factor. Web 0.85, NFL 0.60, NCAA basketball 0.50

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

  1. markov: Markov's method, voting with losses, equivalent to markovvl

  2. markovvl: Markov's method, voting with losses

  3. markovlvpd: Markov's method, losers vote with point differentials

  4. markovwlvp: Markov's method, winners and losers vote with points

Author(s)

Jiangtao Gou

References

Brin, S. and Page, L. (1998). The anatomy of a large-scale hypertextual web search engine. Computer Networks and ISDN Systems 30, 107-117. Proceedings of the Seventh International World Wide Web Conference.

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- markov(jpMat, 
method='markovvl', 
dampingFactor=0.85, 
ties.method='average')
print(result)

Massey's method for Rating and Ranking

Description

Calculate ratings and provide rankings using Massey's method, Masseyized Colley method, Massey's method–no ties, Masseyized Colley method–no ties

Usage

massey(jpMat, method = "massey", ties.method = "average")

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying Massey's method, including "massey", "masseyc", "masseynt" and "masseycnt"

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

  1. massey: Massey's method

  2. masseyc: Masseyized Colley method

  3. masseynt: Massey's method, no ties

  4. masseycnt: Masseyized Colley method, no ties

Author(s)

Jiangtao Gou

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Massey, K. (1997). Statistical models applied to the rating of sports teams. Bachelor's Thesis, Blueeld College.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- massey(jpMat, method='massey')
print(result)

Transform Data to Desired Mean and Standard Deviation

Description

Transform Data to Desired Mean and Standard Deviation

Usage

matchMeanSD(data, mean = 0, sd = 1)

Arguments

data

a vector includeing data to be transformed

mean

a value of desired mean

sd

a value of desirred SD

Value

a vector of transformed vector

Author(s)

Jiangtao Gou

Fengqing Zhang

Examples

orig_data <- c(1,3,5,10)
trans_data <- matchMeanSD(data=orig_data, mean=100, sd=15)
print(trans_data)

Mixed Effects Models for Rating and Ranking

Description

Calculate ratings and provide rankings using Mixed Effects Modeling

Usage

mixedeff(jpMat, REML = FALSE, ties.method = "average")

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

REML

a logical value for lme4::lmer

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Author(s)

Jiangtao Gou

Fengqing Zhang

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Examples

jpMat <- c(1,3,5,2,6,4,3,8,7)
attr(jpMat, "dim") <- c(3,3)
mixedeff(jpMat)

Simple Linear Models for Rating and Ranking

Description

Calculate ratings and provide rankings using Simple Linear regression

Usage

naive(jpMat, stats = FALSE, ties.method = "average")

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

stats

a logical value to indicate whether a linear model should be fitted and the test statistics should be reported

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Author(s)

Jiangtao Gou

Shuyi Wu

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- naive(jpMat)
print(result)

Kleinberg's HITS algorithm for Rating and Ranking with Rectangular Matrix

Description

Calculate ratings and provide rankings using Kleinberg's HITS algorithm, using a rectangular matrix for score matrix (judege-presenter)

Usage

offdefnt(
  jpMat,
  method = "hitsjp",
  totalsupporteps = 0,
  numiter = 100,
  ties.method = "average"
)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying the HITS algorithm, including "hitsjp".

totalsupporteps

a small number to guarantee the total support property

numiter

a number of iterations

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

movie i is good and deserves a high rating mi if it gets high ratings from good (discriminating ) users. Similarly, user j is good and serves a high rating hj when his or her ratings match the true ratings of the movies.

  1. hitsjp: HITS, using judge-presenter matrix, equivalent to offdefsc

  2. offdefnt: Offense-Defense rating method, using judge-presenter matrix

Author(s)

Jiangtao Gou

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Kleinberg, J. M. (1999). Authoritative sources in a hyperlinked environment. Journal of the ACM 46, 604-632.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),nrow=6,byrow=TRUE)
method <- 'hitsjp'
totalsupporteps <- 0.01
numiter <- 10
ties.method <-'average'
result <- offdefnt(jpMat, method, totalsupporteps, numiter, ties.method)
print(result)

Kleinberg's HITS algorithm for Rating and Ranking with Square Matrix

Description

Calculate ratings and provide rankings using Kleinberg's HITS algorithm, using a square matrix for score matrix (presenter-presenter)

Usage

offdefsc(
  jpMat,
  method = "hitspp",
  totalsupporteps = 0,
  totalsupporttype = 1,
  numiter = 100,
  ties.method = "average"
)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

method

a character string specifying the HITS algorithm, including "hitspp".

totalsupporteps

a small number to guarantee the total support property

totalsupporttype

an indicater: 1 stands for matrix ee^T and 2 stands for matrix ee^T - I

numiter

a number of iterations

ties.method

a character string specifying how ties are treated, including "average", "first", "last", "random", "max", "min", from base::rank

Details

Large offense score means strong offense, and large defense score means weak defense

  1. hitspp: HITS, using presenter-presenter matrix, equivalent to offdefsc

  2. offdefsc: Offense-Defense rating method, using presenter-presenter matrix

Author(s)

Jiangtao Gou

References

Gou, J. and Wu, S. (2020). A Judging System for Project Showcase: Rating and Ranking with Incomplete Information. Technical Report.

Kleinberg, J. M. (1999). Authoritative sources in a hyperlinked environment. Journal of the ACM 46, 604-632.

Langville, A. N. and Meyer, C. D. (2012). Who's Number 1?: The Science of Rating and Ranking. Princeton University Press.

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),nrow=6,byrow=TRUE)
 method <- 'hitspp'
totalsupporteps <- 0.01
totalsupporttype <- 1
numiter <- 10
ties.method <-'average'
result <- offdefsc(jpMat, method, totalsupporteps, totalsupporttype, numiter, ties.method)
print(result)

Transform a Judge-Presenter Matrix Converter

Description

Convert a judge-presenter matrix to a set of square matrices

Usage

readJudgePresenterMatrix(jpMat)

Arguments

jpMat

a Judge-Presenter matrix, or a User-Movie matrix

Value

A list, including numGame

  1. numGame: Number of times teams i and j faced eath other

  2. numWin: Number of wins teams i plays against j

  3. numTie: Number of ties teams i plays against j

  4. numLoss: Number of losses teams i plays against j

  5. numPt: Number of points teams i accumulates against j

Author(s)

Jiangtao Gou

Shuyi Wu

Examples

jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,byrow=TRUE)
result <- readJudgePresenterMatrix(jpMat)
print(result)