stats

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stats is deprecated.

Package stats provides basic statistic functions.

Deprecated: use package gnum instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Corr

func Corr(a, b []float64) float64

Corr returns the correlation between the samples. Panics if lengths don't match.

func Cov

func Cov(a, b []float64) float64

Cov returns the covariance of the 2 samples. Panics if lengths don't match.

func Ent

func Ent(distribution []float64) float64

Ent returns the entropy for the given distribution. The distribution does not have to sum up to 1.

func Hist

func Hist(a []float64) (counts map[float64]int, byValue []float64,
	byCount []float64)

Hist creates a histogram of counts of values in the given slice. 'counts' maps a unique value from 'a' to its count. 'byValue' holds uniqe values sorted. 'byCount' holds unique values sorted by their counts, most common first.

func Max

func Max(a []float64) float64

Max returns the maximal element in the sample.

func Mean

func Mean(a []float64) float64

Mean returns the mean value of the sample.

func Min

func Min(a []float64) float64

Min returns the minimal element in the sample.

func Span

func Span(a []float64) float64

Span returns the span of the sample (max - min).

func Std

func Std(a []float64) float64

Std returns the standard deviation of the sample.

func Sum

func Sum(a []float64) float64

Sum returns the sum of values in a sample.

func Var

func Var(a []float64) float64

Var returns the variance of the sample.

Types

This section is empty.

Jump to

Keyboard shortcuts

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