Documentation ¶
Overview ¶
Package onlinestats provides online, one-pass algorithms for descriptive statistics.
The implementation is based on the public domain code available at http://www.johndcook.com/skewness_kurtosis.html .
The linear regression code is from http://www.johndcook.com/running_regression.html .
Index ¶
- func KS(data1, data2 []float64) float64
- func MannWhitney(xs, ys []float64) float64
- func Mean(a []float64) float64
- func Pearson(a, b []float64) float64
- func SWilk(x []float64) (float64, float64, error)
- func SampleStddev(a []float64) float64
- func SampleVariance(a []float64) float64
- func Spearman(data1, data2 []float64) (rs float64, p float64)
- func Sum(a []float64) float64
- func SumSq(a []float64) float64
- func SwilkCoeffs(n int) []float64
- func Tukey(data []float64) []float64
- func Variance(a []float64) float64
- func Welch(xs, ys Stats) float64
- type DEA
- type ExpWeight
- type Regression
- type Reservoir
- type Running
- type Stats
- type SwilkFault
- type WindExp
- type Windowed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KS ¶
KS performs a Kolmogorov-Smirnov test for the two datasets, and returns the p-value for the null hypothesis that the two sets come from the same distribution.
func MannWhitney ¶
MannWhitney performs a Matt-Whitney U test for the two samples xs and ys. It returns the two-tailed p-value for the null hypothesis that the medians of the two samples are the same. This uses the normal approximation which is more accurate if the number of samples is >30.
func SampleStddev ¶
func SampleVariance ¶
func Spearman ¶
Spearman returns the rank correlation coefficient between data1 and data2, and the associated p-value
Types ¶
type DEA ¶
type DEA struct {
// contains filtered or unexported fields
}
http://www.drdobbs.com/tools/discontiguous-exponential-averaging/184410671
func (*DEA) CompletenessFraction ¶
type ExpWeight ¶
type ExpWeight struct {
// contains filtered or unexported fields
}
func NewExpWeight ¶
type Regression ¶
type Regression struct {
// contains filtered or unexported fields
}
func CombineRegressions ¶
func CombineRegressions(a, b Regression) *Regression
func NewRegression ¶
func NewRegression() *Regression
func (*Regression) Correlation ¶
func (r *Regression) Correlation() float64
func (*Regression) Intercept ¶
func (r *Regression) Intercept() float64
func (*Regression) Len ¶
func (r *Regression) Len() int
func (*Regression) Push ¶
func (r *Regression) Push(x, y float64)
func (*Regression) Slope ¶
func (r *Regression) Slope() float64
type Reservoir ¶
type Reservoir struct {
// contains filtered or unexported fields
}
func NewReservoir ¶
type Running ¶
type Running struct {
// contains filtered or unexported fields
}
func CombineRunning ¶
func NewRunning ¶
func NewRunning() *Running
type WindExp ¶
type WindExp struct {
// contains filtered or unexported fields
}
WindExp maintains a window of values, followed by a exponentially-weighted region for the items that have left the window. This is similar to the Average Loss Interval from "Equation-Based Congestion Control for Unicast Applications" ( http://www.icir.org/tfrc/tcp-friendly.pdf ), but with lower update cost. The advantage is that this maintains more local history, but doesn't have the large changes when items leave the window.
func NewWindExp ¶
NewWindExp returns WindExp with the specified window capacity and exponential alpha