Categorygithub.com/gonum/stat
modulepackage
0.0.0-20181125101827-41a0da705a5b
Repository: https://github.com/gonum/stat.git
Documentation: pkg.go.dev

# README

Gonum Stat Build Status Coverage Status GoDoc

This repository is no longer maintained. Development has moved to https://github.com/gonum/gonum.

This is a statistics package for the Go language.

Issues

If you find any bugs, feel free to file an issue on the github issue tracker for gonum/gonum if the bug exists in that reposity; no code changes will be made to this repository. Other dicussions should be taken to the gonum-dev Google Group.

https://groups.google.com/forum/#!forum/gonum-dev

License

Please see github.com/gonum/license for general license information, contributors, authors, etc on the Gonum suite of packages.

# Packages

This repository is no longer maintained.
Package distmat provides probability distributions over matrices.
Package distmv provides multivariate random distribution types.
Package distuv provides univariate random distribution types.
Package samplemv implements advanced sampling routines from explicit and implicit probability distributions.
Package sampleuv implements advanced sampling routines from explicit and implicit probability distributions.

# Functions

Bhattacharyya computes the distance between the probability distributions p and q given by: -\ln ( \sum_i \sqrt{p_i q_i} ) The lengths of p and q must be equal.
CDF returns the empirical cumulative distribution function value of x, that is the fraction of the samples less than or equal to q.
ChiSquare computes the chi-square distance between the observed frequences 'obs' and expected frequences 'exp' given by: \sum_i (obs_i-exp_i)^2 / exp_i The lengths of obs and exp must be equal.
CircularMean returns the circular mean of the dataset.
Correlation returns the weighted correlation between the samples of x and y with the given means.
CorrelationMatrix returns the correlation matrix calculated from a matrix of data, x, using a two-pass algorithm.
Covariance returns the weighted covariance between the samples of x and y.
CovarianceMatrix returns the covariance matrix (also known as the variance-covariance matrix) calculated from a matrix of data, x, using a two-pass algorithm.
CrossEntropy computes the cross-entropy between the two distributions specified in p and q.
Entropy computes the Shannon entropy of a distribution or the distance between two distributions.
ExKurtosis returns the population excess kurtosis of the sample.
GeometricMean returns the weighted geometric mean of the dataset \prod_i {x_i ^ w_i} This only applies with positive x and positive weights.
HarmonicMean returns the weighted harmonic mean of the dataset \sum_i {w_i} / ( sum_i {w_i / x_i} ) This only applies with positive x and positive weights.
Hellinger computes the distance between the probability distributions p and q given by: \sqrt{ 1 - \sum_i \sqrt{p_i q_i} } The lengths of p and q must be equal.
Histogram sums up the weighted number of data points in each bin.
JensenShannon computes the JensenShannon divergence between the distributions p and q.
KolmogorovSmirnov computes the largest distance between two empirical CDFs.
KullbackLeibler computes the Kullback-Leibler distance between the distributions p and q.
LinearRegression computes the best-fit line y = alpha + beta*x to the data in x and y with the given weights.
Mahalanobis computes the Mahalanobis distance D = sqrt((x-y)^T * Σ^-1 * (x-y)) between the vectors x and y given the cholesky decomposition of Σ.
Mean computes the weighted mean of the data set.
MeanStdDev returns the sample mean and standard deviation.
MeanVariance computes the sample mean and variance, where the mean and variance are \sum_i w_i * x_i / (sum_i w_i) \sum_i w_i (x_i - mean)^2 / (sum_i w_i - 1) respectively.
Mode returns the most common value in the dataset specified by x and the given weights.
Moment computes the weighted n^th moment of the samples, E[(x - μ)^N] No degrees of freedom correction is done.
MomentAbout computes the weighted n^th weighted moment of the samples about the given mean \mu, E[(x - μ)^N] No degrees of freedom correction is done.
Quantile returns the sample of x such that x is greater than or equal to the fraction p of samples.
RNoughtSquared returns the coefficient of determination defined as R₀^2 = \sum_i w[i]*(beta*x[i])^2 / \sum_i w[i]*y[i]^2 for the line y = beta*x and the data in x and y with the given weights.
ROC returns paired false positive rate (FPR) and true positive rate (TPR) values corresponding to n cutoffs spanning the relative (or receiver) operator characteristic (ROC) curve obtained when y is treated as a binary classifier for classes with weights.
RSquared returns the coefficient of determination defined as R^2 = 1 - \sum_i w[i]*(y[i] - alpha - beta*x[i])^2 / \sum_i w[i]*(y[i] - mean(y))^2 for the line y = alpha + beta*x and the data in x and y with the given weights.
RSquaredFrom returns the coefficient of determination defined as R^2 = 1 - \sum_i w[i]*(estimate[i] - value[i])^2 / \sum_i w[i]*(value[i] - mean(values))^2 and the data in estimates and values with the given weights.
Skew computes the skewness of the sample data.
SortWeighted rearranges the data in x along with their corresponding weights so that the x data are sorted.
SortWeightedLabeled rearranges the data in x along with their corresponding weights and boolean labels so that the x data are sorted.
StdDev returns the sample standard deviation.
StdErr returns the standard error in the mean with the given values.
StdScore returns the standard score (a.k.a.
Variance computes the weighted sample variance: \sum_i w_i (x_i - mean)^2 / (sum_i w_i - 1) If weights is nil then all of the weights are 1.

# Constants

Empirical treats the distribution as the actual empirical distribution.

# Structs

CC is a type for computing the canonical correlations of a pair of matrices.
PC is a type for computing and extracting the principal components of a matrix.

# Type aliases

CumulantKind specifies the behavior for calculating the empirical CDF or Quantile.