glicko v0.3.0 Glicko

Provides the implementation of the Glicko rating system.

See the specification for implementation details.

Usage

Get a player’s new rating after a series of matches in a rating period.

iex> results = [Result.new(Player.new_v1([rating: 1400, rating_deviation: 30]), :win),
...> Result.new(Player.new_v1([rating: 1550, rating_deviation: 100]), :loss),
...> Result.new(Player.new_v1([rating: 1700, rating_deviation: 300]), :loss)]
iex> player = Player.new_v1([rating: 1500, rating_deviation: 200])
iex> Glicko.new_rating(player, results, [system_constant: 0.5])
{1464.0506705393013, 151.51652412385727}

Get a player’s new rating when they haven’t played within a rating period.

iex> player = Player.new_v1([rating: 1500, rating_deviation: 200])
iex> Glicko.new_rating(player, [], [system_constant: 0.5])
{1.5e3, 200.27141669877065}

Link to this section Summary

Functions

Generate a new rating from an existing rating and a series (or lack) of results

Link to this section Types

Link to this type new_rating_opts_t()
new_rating_opts_t() :: [system_constant: float(), convergence_tolerance: float()]

Link to this section Functions

Link to this function new_rating(player, results, opts \\ [])
new_rating(player :: Glicko.Player.t(), results :: [Glicko.Result.t()], opts :: new_rating_opts_t()) :: Glicko.Player.t()

Generate a new rating from an existing rating and a series (or lack) of results.

Returns the updated player with the same version given to the function.