sketchtest

package module
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

package sketchtest is an internal module with test helpers for generating points from a given distribution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CDF

type CDF func(float64) float64

CDF is the cumulative distribution function of a distribution (inverse of QuantileFunction).

func ExponentialCDF

func ExponentialCDF(lambda float64) CDF

ExponentialCDF is the CDF of the Exponential distribution with parameter lambda. See https://en.wikipedia.org/wiki/Exponential_distribution

func NormalCDF

func NormalCDF(mu, sigma float64) CDF

NormalCDF is the CDF of the Normal distribution with parameters mu and sigma. See https://en.wikipedia.org/wiki/Normal_distribution

func TruncateCDF

func TruncateCDF(a, b float64, cdf CDF) CDF

Truncate a CDF to the interval (a,b). See https://en.wikipedia.org/wiki/Truncated_distribution.

type QuantileFunction

type QuantileFunction func(float64) float64

QuantileFunction for a distribution. The function MUST be defined in (0,1). The function MAY return the minimum at 0 and the maximum at 1, for distributions where this makes sense.

func ExponentialQ

func ExponentialQ(lambda float64) QuantileFunction

ExponentialQ is the quantile function of the Exponential distribution with parameter lambda See https://en.wikipedia.org/wiki/Exponential_distribution

func NormalQ

func NormalQ(mu, sigma float64) QuantileFunction

NormalQ is the quantile function of the Normal distribution with parameters mu and sigma. See https://en.wikipedia.org/wiki/Normal_distribution

func TruncateQ

func TruncateQ(a, b float64, quantile QuantileFunction, cdf CDF) QuantileFunction

Truncate a quantile function to the interval [a,b] given its CDF. See https://en.wikipedia.org/wiki/Truncated_distribution. This function assumes but does not check that quantile is the inverse of cdf.

func UQuadraticQ

func UQuadraticQ(a, b float64) QuantileFunction

UQuadraticQ returns the quantile function for an U-Quadratic distribution with parameters a and b. See https://en.wikipedia.org/wiki/U-quadratic_distribution

func UniformQ

func UniformQ(a, b float64) QuantileFunction

UniformQ returns the quantile function for an uniform distribution with parameters a and b. See https://en.wikipedia.org/wiki/Continuous_uniform_distribution

Jump to

Keyboard shortcuts

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