Documentation
¶
Index ¶
- func Choose(n int, k int) int
- func Factorial(n int) int
- func LSR(data [][]float64) []float64
- func MeanFloat64(data []float64) float64
- func MeanInt(data []int) float64
- func MedianFloat64(data []float64) float64
- func MedianInt(data []int) float64
- func Seed()
- func SumFloat64(data []float64) float64
- func SumInt(data []int) int
- type BernoulliType
- type BinomialType
- type ExponentialType
- type GeometricType
- type LaplaceType
- type NegativeBinomialType
- type PoissonType
- type WeibullType
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LSR ¶
Example ¶
data := [][]float64{{60.0, 3.1}, {61.0, 3.6}, {62.0, 3.8}, {63, 4}, {65.0, 4.1}} fmt.Println(stats.LSR(data))
Output: [-7.963513513513208 0.18783783783783292]
func MeanFloat64 ¶
func MedianFloat64 ¶
func SumFloat64 ¶
Example ¶
s := []float64{2, 3, 5, 7, 11, 13} sum := stats.SumFloat64(s) fmt.Println(sum)
Output: 41
Types ¶
type BernoulliType ¶
type BernoulliType struct {
// contains filtered or unexported fields
}
func Bernoulli ¶
func Bernoulli(p float64) BernoulliType
func FitBernoulli ¶
func FitBernoulli(data []int) BernoulliType
Example ¶
data := []int{1, 1, 1, 0, 0} b := stats.FitBernoulli(data) fmt.Println(b.Cdf(0))
Output: 0.4
func (BernoulliType) Quantile ¶
func (b BernoulliType) Quantile(p float64) int
type BinomialType ¶
type BinomialType struct {
// contains filtered or unexported fields
}
func Binomial ¶
func Binomial(n int, p float64) BinomialType
func (BinomialType) Quantile ¶
func (b BinomialType) Quantile(x float64) int
type ExponentialType ¶
type ExponentialType struct {
// contains filtered or unexported fields
}
func Exponential ¶
func Exponential(l float64) ExponentialType
func FitExponential ¶
func FitExponential(data []float64) ExponentialType
Example ¶
data := []float64{10, 3, 3, 4, 5} g := stats.FitExponential(data) fmt.Println(g.Quantile(.5))
Output: 3.465735902799726
func (ExponentialType) Quantile ¶
func (e ExponentialType) Quantile(p float64) float64
type GeometricType ¶
type GeometricType struct {
// contains filtered or unexported fields
}
func FitGeometric ¶
func FitGeometric(data []int) GeometricType
Example ¶
data := []int{10, 3, 3, 4, 5} g := stats.FitGeometric(data) fmt.Println(g.Quantile(.5))
Output: 4
func Geometric ¶
func Geometric(p float64) GeometricType
func (GeometricType) Quantile ¶
func (g GeometricType) Quantile(p float64) int
type LaplaceType ¶
type LaplaceType struct {
// contains filtered or unexported fields
}
func FitLaplace ¶
func FitLaplace(data []float64) LaplaceType
Example ¶
data := []float64{1, 1, 1, 0, 0} l := stats.FitLaplace(data) fmt.Println(l.Quantile(.5))
Output: 1
func Laplace ¶
func Laplace(mean float64, b float64) LaplaceType
func (LaplaceType) Quantile ¶
func (l LaplaceType) Quantile(p float64) float64
type NegativeBinomialType ¶
type NegativeBinomialType struct {
// contains filtered or unexported fields
}
func NegativeBinomial ¶
func NegativeBinomial(k int, p float64) NegativeBinomialType
func (NegativeBinomialType) Quantile ¶
func (b NegativeBinomialType) Quantile(x float64) int
type PoissonType ¶
type PoissonType struct {
// contains filtered or unexported fields
}
func FitPoisson ¶
func FitPoisson(data []int) PoissonType
Example ¶
data := []int{10, 3, 3, 4, 5} p := stats.FitPoisson(data) fmt.Println(p.Quantile(.5))
Output: 5
func Poisson ¶
func Poisson(m float64) PoissonType
func (PoissonType) Quantile ¶
func (p PoissonType) Quantile(x float64) int
type WeibullType ¶
type WeibullType struct {
// contains filtered or unexported fields
}
func Weibull ¶
func Weibull(l float64, k float64) WeibullType
func (WeibullType) Quantile ¶
func (w WeibullType) Quantile(p float64) float64
Click to show internal directories.
Click to hide internal directories.