uv

package
v0.0.0-...-768eb72 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfidenceInterval

func ConfidenceInterval(q Quantiler, p float64) (l, u float64, err error)

ConfidenceInterval constructs a confidence interval with confidence level p, where higher confidence in [0,1] means a wider interval.

Types

type Beta

type Beta struct {
	Alpha float64
	Beta  float64
}

Beta is the beta distribution.

type Binomial

type Binomial struct {
	N float64
	P float64
}

Binomial is the binomial distribution.

type InverseGamma

type InverseGamma struct {
	Shape float64
	Scale float64
}

InverseGamma is the inverse gamma distribution.

func NewInverseGamma

func NewInverseGamma(shape, scale float64) (i *InverseGamma, err error)

NewInverseGamma constructs an InverseGamma, validating the provided parameters.

func (*InverseGamma) Mean

func (i *InverseGamma) Mean() float64

Mean returns the first moment of the distribution, for shape > 1.

func (*InverseGamma) Variance

func (i *InverseGamma) Variance() float64

Variance returns the second central moment of the distribution, for shape > 2.

type LogNormal

type LogNormal struct {
	Location float64
	Scale    float64
}

LogNormal is the log normal distribution.

func NewLogNormal

func NewLogNormal(location, scale float64) (ln *LogNormal, err error)

NewLogNormal creates a new lognormal distribution, ensuring first that the provided scale is strictly positive.

func (*LogNormal) Quantile

func (ln *LogNormal) Quantile(p float64) (q float64, err error)

Quantile is the inverse function of the log normal CDF.

type NegBinomial

type NegBinomial struct {
	Location float64
	Scale    float64
}

NegBinomial is the negative binomial distribution.

type Normal

type Normal struct {
	Location float64
	Scale    float64
}

Normal distribution defined by its mean and standard deviation.

func NewNormal

func NewNormal(location, scale float64) (n *Normal, err error)

NewNormal checks the input parameters and returns a Normal constructed using them, if they are valid.

func (*Normal) Mean

func (n *Normal) Mean() float64

Mean returns the first moment of the distribution.

func (*Normal) Quantile

func (n *Normal) Quantile(p float64) (q float64, err error)

Quantile is the inverse function of the CDF.

func (*Normal) Variance

func (n *Normal) Variance() float64

Variance returns the second central moment of the distribution.

type Quantiler

type Quantiler interface {
	Quantile(p float64) (q float64, err error)
}

Quantiler defines distributions that have computable quantiles. That is, which accept a probability on [0,1] and return a member in their support.

Jump to

Keyboard shortcuts

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