Skip to content

Games with very low draw probabilities (ValueError: math domain error in trunc) #16

@sjjbirch

Description

@sjjbirch

Attempting to set a draw probability of 0.001 on a History results in a math domain error using my data. A probability of 0.01 works fine. This is for values of 1200, 400, 300 and 12 for mu, sigma, gamma and beta. Further lowering gamma further constrains the minimum value of draw probability that can be used, but the relationship isn't fully linear, and there can be combinations of gamma, beta and draw probability that fail when combinations on either side of them work fine.

The domain error arises in the trunc() function where sigma_trunc is calculated (call chain is History->trueskill->iteration->compute_likelihoods->likelihood_teams->approx->trunc). It can also arise during convergence, obviously the call stack is a little different there.

This is a little bit of an issue for me because the results I'm working on have a draw probability much lower than that. Actually I don't think there has ever been a global draw in the game I'm working on and in practice I don't think it would be permitted. I would actually like to use a draw probability of either 0.0 or 0x00000001/0x0000000000000001. While some positions in some circumstances might very rarely be drawn, there can never be a drawn game.

Admittedly I'm on 1.1.0...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions