PHP Glicko2 Lib

This is a simple implementation of the Glicko-2 algorithm for competitive ranking.


More information on this algorithm can be found here: Glicko-2 rating system by Mark Glickman.

The Glicko-2 system is designed to rank competitors in games and sports. It has better reliability and convergence metrics ratings than Elo or Glicko.


The library works independently of the competitors in the system. One, some, or all of the competitors can be evaluated based on their existing metrics and global parameters for the competition. There are only three sets of operations available:
  1. Match/Comparison operations (AddWin(), AddLoss()); then
  2. Match rating calculation (Update()); and finally
  3. Variable output. You can use these for advanced inspection, or simply store them post-calculation and pass them back in pre-calculation.
    • $rating
    • $rd
    • $sigma
    • $mu
    • $phi
    • $tau
It is important to note that every player should have Update() run for each period, regardless of their participation during that time period or not. Update()'ing non-participant players updates their RD values (rating deviation -- the measure of the reliability of the player's score).

Basic use is as follows:

// Create players // Alice is an existing player $Alice = new Glicko2Player( $player['Alice']['rating'], $player['Alice']['rd'], $player['Alice']['sigma'], $player['Alice']['mu'], $player['Alice']['phi'], $player['Alice']['tau']); // Bob is a new player $Bob = new Glicko2Player(); // Charlie is a new player $Charlie = new Glicko2Player(); // David is an existing player $David = new Glicko2Player( $player['David']['rating'], $player['David']['rd'], $player['David']['sigma'], $player['David']['mu'], $player['David']['phi'], $player['David']['tau']); // Alice vs. Bob $Alice->AddWin($Bob); $Bob->AddLoss($Alice); // Alice vs. Charlie $Alice->AddWin($Charlie) $Charlie->AddLoss($Alice); // Bob vs. Charlie $Bob->AddWin($Charlie); $Charlie->AddLoss($Bob); // David does not participate // Update ratings $Alice->Update(); $Bob->Update(); $Charlie->Update(); $David->Update();

Project Details


Download project files.

Project Summary

Project summary page.

Get via SVN

svn co glicko2phplib