scttcper/ts-trueskill

Floating Point Error

cofinley opened this issue · 0 comments

Hello,

I'm not overly familiar with the stats involved, but I'm getting a floating point error for the following example and would like to understand more about why it's happening:

import { Rating, rate_1vs1 } from "ts-trueskill"

var a = new Rating(1253.199676483443, 1.315432946114797)
var b = new Rating(2038.349704507679, 1.136131282892949)

rate_1vs1(a, b)

The initial mu is 1600 and sigma is 1600/3. Both a and b have been rated ~ 100 times.

I get the following stack trace:

Error: floating point error
    at TrueSkill._wWin (...ts-trueskill/dist/src/trueskill.js:266:15)
    at TruncateFactor.wFunc (...ts-trueskill/dist/src/trueskill.js:350:40)
    at TruncateFactor.up (...ts-trueskill/dist/src/factorgraph.js:238:24)
    at TrueSkill._runSchedule (...ts-trueskill/dist/src/trueskill.js:382:39)
    at TrueSkill.rate (...ts-trueskill/dist/src/trueskill.js:129:29)
    at rate_1vs1 (...ts-trueskill/dist/src/trueskill.js:423:23)

I'm using ts-trueskill 4.2.1

I can inspect the trace and see why the exception is being thrown from the values, but from a stats perspective, I don't know why this is happening. The variable names are somewhat terse and hard to reason about. From what I can tell, the mu and sigma values don't seem too weird, but I'm not sure. Maybe one of them is too low/high?

Thank you in advance.