Module skillratings::sticko

source ·
Expand description

This is the Stephenson rating algorithm, nicknamed “Sticko” due to it being an improvement on the Glicko rating algorithm.
Allows for player advantages, and the winner of a chess outcome prediction competition.

For the original Glicko algorithm, please see Glicko, or for the improved versions see Glicko-Boost or Glicko-2.

In 2012, the data prediction website Kaggle hosted the “FIDE/Deloitte Chess Rating Challenge” where competitors where asked to create a new, more accurate chess rating system.
The winner of the competition was Alec Stephenson, and this was the system he came up with.

The main improvements over Glicko are three new configurable parameters found in StickoConfig:

  • Gamma (γ) an advantage parameter that accounts for inherent advantages in-game (White in Chess, etc.)
  • Beta (β) a drift parameter that increases rating for participating
  • Lambda (λ) a parameter that accounts for the strength of the opponent, regardless of result.

These make Sticko more configurable and possibly more accurate than the Glicko algorithm. When all parameters are set to 0, the Sticko algorithm will produce the exact same results as Glicko.

Quickstart

This is the most basic example on how to use the Sticko Module.
Please take a look at the functions below to see more advanced use cases.

use skillratings::{
    sticko::{sticko, StickoConfig, StickoRating},
    Outcomes,
};

// Initialise a new player rating with a rating of 1500 and a deviation of 350.
let player_one = StickoRating::new();

// Or you can initialise it with your own values of course.
// Imagine these numbers being pulled from a database.
let (some_rating, some_deviation) = (1325.0, 230.0);
let player_two = StickoRating {
    rating: some_rating,
    deviation: some_deviation,
};

// The outcome of the match is from the perspective of player one.
let outcome = Outcomes::WIN;

// The config allows you to specify certain values in the Sticko calculation.
// For more information on how to customise the config,
// please check out the StickoConfig struct.
let config = StickoConfig {
    // The gamma value describes the advantage of player_one.
    // 30.0 is roughly accurate for playing White in Chess.
    // If player_two was to play White, change this to -30.0.
    // By default it is set to 0.0.
    gamma: 30.0,
    // We leave the other settings at their default values.
    ..Default::default()
};

// The sticko function will calculate the new ratings for both players and return them.
let (new_player_one, new_player_two) = sticko(&player_one, &player_two, &outcome, &config);

More Information

Structs

Functions