glicko-0.1.1.1: Glicko-2 implementation in Haskell.

LicenseGPL-3
Maintainerprillan91@gmail.com
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 { _pid = 1
       , _rating = 1464.0506705393013
       , _dev = 151.51652412385727
       , _vol = 5.9995984286488495e-2
       , _inactivity = 0
       , _age = 1 }
>>> p2
Player { _pid = 2
       , _rating = 1398.1435582337338
       , _dev = 31.67021528115062
       , _vol = 5.999912372888531e-2
       , _inactivity = 0
       , _age = 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

Player A

-> Player

Player B

-> Double 

Computes the probability that Player A wins against Player B

predictBoX :: BoX -> Player -> Player -> 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

Show BoX Source # 

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