Learn R Programming

mau (version 0.4.0)

colley_rating: Colley method

Description

Rank computation using the Cooley method with ties if required

Usage

colley_rating(n, w, l, t = NULL)

Value

Vector with ratings

Arguments

n

symmetric matrix of number of times each player faced another, zero diagonal

w

accumulated vector of wins for each player

l

accumulated vector of losses for each player

t

symmetric matrix of ties, with zero diagonal

Author

Pedro Guarderas pedro.felipe.guarderas@gmail.com

Examples

Run this code
d <- 10
n <- matrix( sample( x = 0:5, size = d * d, replace = TRUE ), d, d )
n <- n + t( n )
diag( n ) <- 0
g <- rowSums( n )
# Number of win matches for each team
w <- sapply( 1:d, FUN = function( i ) sample( x = 1:g[i], size = 1, replace = TRUE ) )
# Number of lost matches for ech team
l <- rowSums( n ) - w
r <- colley_rating( n, w, l )

Run the code above in your browser using DataLab