glicko-0.3.0.2: Glicko-2 implementation in Haskell.
LicenseGPL-3
Maintainerrasmus@precenth.eu
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Ranking.Glicko.Inference

Description

This module provides functions for predicting the outcome of a game between two players.

Example usage:

>>> :l test/Paper.hs
>>> :m + Data.Default
>>> let p1:p2:_ = compute players matches def
>>> p1
Player { playerId = 1
       , playerRating = 1464.0506705393013
       , playerDev = 151.51652412385727
       , playerVol = 5.9995984286488495e-2
       , playerInactivity = 0
       , playerAge = 1 }
>>> p2
Player { playerId = 2
       , playerRating = 1398.1435582337338
       , playerDev = 31.67021528115062
       , playerVol = 5.999912372888531e-2
       , playerInactivity = 0
       , playerAge = 1 }
>>> predict p1 p2
0.5732533698644847     -- Player 1 has a 57.3% chance of winning a single game.
>>> let Just f = boX 5
>>> predictBoX f p1 p2
0.6353973157904573     -- Player 1 has a 63.5% chance of winning a best-of-five match.
Synopsis

Documentation

predict Source #

Arguments

:: Player 1

Player A

-> Player 1

Player B

-> Double 

Computes the probability that Player A wins against Player B

predictBoX :: BoX -> Player 1 -> Player 1 -> Double Source #

Same as predict, but computes the probability that Player A wins a match played as best-of-X games.

data BoX Source #

Represents a match played as best-of-X games.

Instances

Instances details
Show BoX Source # 
Instance details

Defined in Ranking.Glicko.Inference

Methods

showsPrec :: Int -> BoX -> ShowS #

show :: BoX -> String #

showList :: [BoX] -> ShowS #

boX :: Integer -> Maybe BoX Source #

Create a best-of-X match

fromBoX :: BoX -> Integer Source #

Destruct a best-of-X match