← All procedures

statistics.glicko2Update

The Glicko-2 update of one player after one rating period (Glickman, "Example of the Glicko-2 system", 2012). The function uses the Illinois algorithm for the new volatility. The games use the ratings of the opponents from the start of the period. An empty list of games gives `glicko2Idle(player)`.

CLI
Package
@procedures/statistics · README
Path
["statistics","glicko2Update"]
CLI
mark statistics glicko2Update --player <object> --games <object[]>
As data
{"$proc":["statistics","glicko2Update"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/statistics/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["statistics","glicko2Update"], { player: {}, games: [] });
console.log(JSON.stringify(result));

From the command line

$ mark statistics glicko2Update --player <object> --games <object[]>

As data, in a program

{
  "$proc": ["statistics", "glicko2Update"],
  "input": { "player": {}, "games": [] }
}

Input

FieldTypeRequiredDefaultDescription
playerobjectyes
gamesobject[]yes
optionsobjectno

Output

FieldTypeRequiredDefaultDescription
ratingnumberyes
rdnumberyesThe rating deviation, in rating points. It is above 0.
volatilitynumberyesThe volatility: the expected size of a change of the true strength in one rating period. It is above 0.
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "player": {
        "type": "object",
        "properties": {
          "rating": {
            "type": "number"
          },
          "rd": {
            "type": "number",
            "description": "The rating deviation, in rating points. It is above 0."
          },
          "volatility": {
            "type": "number",
            "description": "The volatility: the expected size of a change of the true strength in one rating period. It is above 0."
          }
        },
        "required": [
          "rating",
          "rd",
          "volatility"
        ],
        "additionalProperties": {}
      },
      "games": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "rating": {
              "type": "number"
            },
            "rd": {
              "type": "number"
            },
            "score": {
              "type": "number",
              "description": "The score of the player: 1 for a win, 0.5 for a tie and 0 for a loss."
            }
          },
          "required": [
            "rating",
            "rd",
            "score"
          ],
          "additionalProperties": {}
        }
      },
      "options": {
        "type": "object",
        "properties": {
          "tau": {
            "type": "number",
            "description": "The constraint on the change of the volatility over time (tau). The default is 0.5. Glickman uses 0.3 to 1.2."
          },
          "tolerance": {
            "type": "number",
            "description": "The tolerance of the iteration for the new volatility (epsilon). The default is 0.000001, as in the paper."
          }
        },
        "additionalProperties": {}
      }
    },
    "required": [
      "player",
      "games"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "object",
    "properties": {
      "rating": {
        "type": "number"
      },
      "rd": {
        "type": "number",
        "description": "The rating deviation, in rating points. It is above 0."
      },
      "volatility": {
        "type": "number",
        "description": "The volatility: the expected size of a change of the true strength in one rating period. It is above 0."
      }
    },
    "required": [
      "rating",
      "rd",
      "volatility"
    ],
    "additionalProperties": {}
  }
}