|
Cute Chess
0.1
|
A Sequential Probability Ratio Test. More...
#include <sprt.h>
Classes | |
| struct | Status |
Public Types | |
| enum | GameResult { NoResult, Win, Loss, Draw } |
| enum | Result { Continue, AcceptH0, AcceptH1 } |
Public Member Functions | |
| void | addGameResult (GameResult result) |
| void | initialize (double elo0, double elo1, double alpha, double beta) |
| bool | isNull () const |
| Sprt () | |
| Status | status () const |
A Sequential Probability Ratio Test.
The Sprt class implements a Sequential Probability Ratio Test (SPRT) that can be used as a termination criterion for stopping a match between two players when the Elo difference is known to be outside of the specified interval.
| enum Sprt::GameResult |
| enum Sprt::Result |
| Sprt::Sprt | ( | ) |
Creates a new uninitialized Sprt object.
| void Sprt::addGameResult | ( | GameResult | result | ) |
Updates the test with result.
After calling this function, status() should be called to check if H0 or H1 can be accepted.
| void Sprt::initialize | ( | double | elo0, |
| double | elo1, | ||
| double | alpha, | ||
| double | beta | ||
| ) |
Initializes the SPRT.
elo0 is the Elo difference between player A and player B for H0 and elo1 for H1.
alpha is the maximum probability for a type I error and beta for a type II error outside interval [elo0, elo1].
| bool Sprt::isNull | ( | ) | const |
Returns true if the SPRT is uninitialized; otherwise returns false.
| Sprt::Status Sprt::status | ( | ) | const |
Returns the current status of the test.
1.8.11