View source: R/rating_methods.R
colley_rating | R Documentation |
Rank computation using the Cooley method with ties if required
colley_rating(n, w, l, t = NULL)
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 |
Vector with ratings
Pedro Guarderas pedro.felipe.guarderas@gmail.com
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.