glicko2

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 1 Imported by: 1

README

glicko2

Go implementation of the glicko2 calculations

Documentation

Overview

Package glicko2 implements the Glicko 2 ranking system. It defines a method which can compute the ranking of a player, given plays against opponents for a tournament.

The code follows the Glicko2 paper quite precisely, except that it uses Ridder's method for finding roots. It does a bit of allocation, but in my tests it is by far the fastest code among solutions in Erlang, Go and OCaml. There are numerous places of low-hanging fruit, should the code prove to run too slowly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rank

func Rank(r, rd, sigma float64, opponents []Opponent, tau float64) (nr, nrd, nsigma float64)

Rank ranks a player given a list of opponents. In order to rank a player, you must supply the rating r, the rating deviance rd and the volatility, sigma (σ). You must also supply a list of opponents as a []Opponent. And you must supply the configuration parameter tau (τ) Good values of tau are between 0.3 and 1.2. You will have to tune your data set to find a good tau by running a prediction algorithm. The function returns three values, nr, nrd, nsigma for the new rating, rating deviation and sigma/volatility value respectively.

func Skip

func Skip(r, rd, sigma float64) float64

Skip is used when a player skips a tournament. In the case where a player skips a tournament, we will keep the rating, r, and the volatility, sigma, of the player the same, but the rating deviation, rd, will change. This function returns the new rating deviation of the player

Types

type Opponent

type Opponent interface {
	R() float64
	RD() float64
	Sigma() float64
	SJ() float64
}

The Opponent interface is used to define opponents in a tournament. It is given as a slice to the ranker and every element in the slice is treated as a game that was played in the tournament. The interface must return the rating via R(); the rating deviance via RD() and the current σ value via Sigma(). The value SJ() encodes the outcome of the match. If the player for which we rank won the match, return 1.0. If the player lost, return 0.0. If the match was a draw, return 0.5. Note that Glicko2 is not really strong and handling draws.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL