Statistics

object Statistics

Standard statistics utilities.

Standard statistics utilities.

Note: significance level alpha is equal to 1 - confidenceLevel. If you want to be sure that 2 sets of measurements do not differ with 90 percent probability, then the significance level alpha should be set to 0.1. In this example, the confidence level is 0.9, and the significance level is 0.1.

class Object
trait Matchable
class Any

Type members

Classlikes

case class ANOVAFTest(alternatives: Seq[Seq[Double]], alpha: Double) extends Test

ANOVA separates the total variation in a set of measurements into a component due to random fluctuations in the measurements and a component due to the actual differences among the alternatives.

ANOVA separates the total variation in a set of measurements into a component due to random fluctuations in the measurements and a component due to the actual differences among the alternatives.

If the variation between the alternatives is larger than the variation within each alternative, then it can be concluded that there is a statistically significant difference between the alternatives.

For more information see: Andy Georges, Dries Buytaert, Lieven Eeckhout - Statistically Rigorous Java Performance Evaluation

case class CoVTest(measurements: Seq[Double], threshold: Double) extends Test

Compares the coefficient of variance to some threshold value.

Compares the coefficient of variance to some threshold value.

This heuristic can be used to detect if the measurement has stabilized.

case class ConfidenceIntervalTest(strict: Boolean, alt1: Seq[Double], alt2: Seq[Double], alpha: Double) extends Standard2WayTest

Compares two alternative sets of measurements given a significance level alpha.

Compares two alternative sets of measurements given a significance level alpha.

Value Params
strict

if true, the confidence interval test is strict - the confidence interval overlap of the alternatives will not be additionally compared

Returns

returns true if there is no statistical difference for s.l. alpha

case class OverlapTest(alt1: Seq[Double], alt2: Seq[Double], alpha: Double, noiseMagnitude: Double) extends Standard2WayTest

Computes the confidence interval of the two alternatives. Passes if the confidence intervals overlap at the given significance level alpha.

Computes the confidence interval of the two alternatives. Passes if the confidence intervals overlap at the given significance level alpha.

Applies relative noise before doing the actual overlap test - the relative noise may increase the confidence interval further, but it will not shrink it.

abstract class Standard2WayTest extends Test
trait Test

Value members

Concrete methods

def CoV(measurements: Seq[Double]): Double
def SSA(alternatives: Seq[Seq[Double]]): Double

Computes sum-of-squares due to differences between alternatives.

Computes sum-of-squares due to differences between alternatives.

def SSE(alternatives: Seq[Seq[Double]]): Double

Computes sum-of-squares due to errors in measurements.

Computes sum-of-squares due to errors in measurements.

def clamp(x: Double, below: Double, above: Double): Double
def confidenceInterval(seq: Seq[Double], alpha: Double): (Double, Double)

Let Y = (Y_1, ..., Y_n) data resulting from a parametric law F of scalar parameter θ. A confidence interval (B_i, B_s) is a statistic in the form of an interval containing θ with a specified probability.

Let Y = (Y_1, ..., Y_n) data resulting from a parametric law F of scalar parameter θ. A confidence interval (B_i, B_s) is a statistic in the form of an interval containing θ with a specified probability.

def mean(seq: Seq[Double]): Double

Computes the mean of the sequence of measurements.

Computes the mean of the sequence of measurements.

def stdev(seq: Seq[Double]): Double

The sample standard sample deviation. It is the square root of S², unbiased estimator for the variance.

The sample standard sample deviation. It is the square root of S², unbiased estimator for the variance.

Implicits

Implicits

implicit def test2boolean(t: Test): Boolean