Documentation ¶
Index ¶
- func DrawCDF(cdf CDF, p float64, lineColor color.Color, fillColor color.Color, w int, h int) image.Image
- func DrawCDFs(cdfs []CDF, p float64, lineColors []color.Color, fillColors []color.Color, ...) image.Image
- func DrawPDF(cdf CDF, p float64, lineColor color.Color, fillColor color.Color, w int, h int) image.Image
- func DrawPDFs(cdfs []CDF, p float64, lineColors []color.Color, fillColors []color.Color, ...) image.Image
- func KSTest(cdf CDF, sample []float64) float64
- func KolmogorovSmirnovTest(cdf CDF, sample []float64) float64
- type Condition
- func And(conds ...Condition) Condition
- func Apply1b(A CDF, f func(float64) bool, n int) (Condition, error)
- func Apply2b(A CDF, B CDF, f func(float64, float64) bool, n int) (Condition, error)
- func Apply3b(A CDF, B CDF, C CDF, f func(float64, float64, float64) bool, n int) (Condition, error)
- func False() Condition
- func Not(cond Condition) Condition
- func Or(conds ...Condition) Condition
- func P(p float64) Condition
- func True() Condition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawCDF ¶
func DrawCDF(cdf CDF, p float64, lineColor color.Color, fillColor color.Color, w int, h int) image.Image
Plots a CDF and returns it as an image.
The Y axis of the image will always be [0, 1] inclusive.
The X axis is specified by the p parameter. It specifies the probability range that should be plotted. For example, using p=0.05 the X axis of the image will include the values in the range [V(.05), V(.95)] inclusive.
The background is set to the transparent value.
func DrawCDFs ¶
func DrawCDFs(cdfs []CDF, p float64, lineColors []color.Color, fillColors []color.Color, w int, h int) image.Image
Plots one or more CDFs on the same graph. See DrawCDF for details.
func DrawPDF ¶
func DrawPDF(cdf CDF, p float64, lineColor color.Color, fillColor color.Color, w int, h int) image.Image
Plots a PDF and returns it as an image.
The X axis is specified by the p parameter. It specifies the probability range that should be plotted. For example, using p=0.05 the X axis of the image will include the values in the range [V(.05), V(.95)] inclusive.
The Y axis if the image will always be in the range (0, max), where max is the largest Y value of the PDF.
The background is set to the transparent value.
func DrawPDFs ¶
func DrawPDFs(cdfs []CDF, p float64, lineColors []color.Color, fillColors []color.Color, w int, h int) image.Image
Plots one or more PDFs in the same image. See DrawPDF fr details.
func KolmogorovSmirnovTest ¶
Runs a Kolmogorov-Smirnov test for a given sample and reference distribution.
The returned value is the calculated confidence level, an estimate of the likelihood that the given sample comes from the reference distribution.
See: https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
Types ¶
type Condition ¶
type Condition interface { /* Returns the probability that the condition will be true. */ P() float64 }
An interface that represents a boolean-typed random variable. Think of it as something that can either happen or not happen with some probability.