testutils

package
v0.0.0-...-a158526 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ADErrFix

func ADErrFix(N, p float64) (float64, error)

ADErrFix provides a correction term that de-resolves an infinite AD distribution (or at least the approximation we use) down to a resolution of N. Takes a sample size N and an AD p-value p as inputs.

Returns 0 if N <= 0, or if p is not a value between 0 and 1.

func ADPValue

func ADPValue(z float64) (float64, error)

ADPValue computes and returns the p-value of the given a-statistic. Returns -1 and error if the z-statistic is 0 or less.

This computation uses the adinf(z) approximation in Marsaglia & Marsaglia [1]. The approximation is split into two regimes based on whether or not the test statistic z >= 2.

func ADStatistic

func ADStatistic(rawSamples []float64) (float64, error)

ADStatistic computes the a-statistic of the given sample. Currently only supports normal distributions. Returns an error on an empty sample.

func AndersonDarlingTest

func AndersonDarlingTest(samples []float64) (float64, error)

AndersonDarlingTest takes a sample of floating-point numbers and performs the Anderson-Darling test for numerical distribution. It returns a p-value of the resulting test statistic, with a high p-value (>= 0.95, conventionally) indicating that the null hypothesis of a normal distribution can be rejected.

Returns a negative p-value and an error if the sample is empty.

This method of computing the Anderson-Darling test uses the approximation from: [1] Marsaglia, John & Marsaglia, George. (2004). Evaluating the Anderson-Darling Distribution. Journal of Statistical Software. 09. 10.18637/jss.v009.i02.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL