ScoreInterval

class ScoreInterval(val successes: Int, val trials: Int, val low: Double, val high: Double)

A measured rate with the range the sample it came from actually supports.

A catch rate is an estimate from a finite corpus, and a corpus of a hundred pairs supports an estimate about nine points wide in each direction. Printing 68% beside 73% invites the reader to conclude that something improved, when at that sample size the two are the same measurement. Every rate this project publishes carries one of these for that reason.

The interval is Wilson's score interval, not the textbook normal approximation. The normal one is wrong exactly where these numbers live: it produces bounds below zero or above one for rates near the edges, and it collapses to a zero-width interval when a guard catches nothing or catches everything, which is the one case where the sample says least. Wilson stays inside [0, 1] and stays wide at the edges.

Constructors

Link copied to clipboard
constructor(successes: Int, trials: Int, low: Double, high: Double)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Half the interval's width, in percentage points. The number to quote as "plus or minus".

Link copied to clipboard

Upper bound of the interval, in [0.0, 1.0].

Link copied to clipboard
val low: Double

Lower bound of the interval, in [0.0, 1.0].

Link copied to clipboard
val rate: Double?

The point estimate, or null when nothing was measured. Zero of zero is not a rate of zero.

Link copied to clipboard

Successes observed.

Link copied to clipboard
val trials: Int

Trials observed. Zero means nothing was measured, and rate is then null.

Functions

Link copied to clipboard

Whether this rate and other are far enough apart that the difference is not the sample.

Link copied to clipboard
open override fun toString(): String