stats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package stats provides statistical functions and algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorrMatrix

func CorrMatrix(df *dataframe.DataFrame, method string) (*dataframe.DataFrame, error)

CorrMatrix computes the correlation matrix for all numeric columns in a DataFrame.

func CovMatrix

func CovMatrix(df *dataframe.DataFrame) (*dataframe.DataFrame, error)

CovMatrix computes the covariance matrix for all numeric columns.

func Covariance

func Covariance(x, y []float64) float64

Covariance calculates the sample covariance between x and y.

func IQR

func IQR(values []float64) float64

IQR calculates the interquartile range (Q3 - Q1).

func Kendall

func Kendall(x, y []float64) (float64, error)

Kendall calculates the Kendall tau correlation coefficient. Measures the ordinal association between two quantities.

func Kurtosis

func Kurtosis(values []float64) float64

Kurtosis calculates the excess kurtosis.

func Mean

func Mean(values []float64) float64

Mean calculates the arithmetic mean of values.

func Median

func Median(values []float64) float64

Median calculates the median of values.

func Mode

func Mode(values []float64) (float64, int)

Mode finds the most frequent value and its frequency.

func Pearson

func Pearson(x, y []float64) (float64, error)

Pearson calculates the Pearson correlation coefficient between x and y. Returns value in [-1, 1] where: 1 = perfect positive correlation 0 = no correlation -1 = perfect negative correlation

func Percentile

func Percentile(values []float64, p float64) float64

Percentile calculates the p-th percentile (0 <= p <= 100).

func Quantile

func Quantile(values []float64, q float64) float64

Quantile calculates the q-th quantile (0 <= q <= 1). Uses linear interpolation between closest ranks.

func Range

func Range(values []float64) float64

Range calculates the range (max - min) of values.

func Skew

func Skew(values []float64) float64

Skew calculates the sample skewness (Fisher-Pearson coefficient).

func Spearman

func Spearman(x, y []float64) (float64, error)

Spearman calculates the Spearman rank correlation coefficient.

func Std

func Std(values []float64) float64

Std calculates the sample standard deviation.

func Var

func Var(values []float64) float64

Var calculates the sample variance.

Types

type DescriptiveStats

type DescriptiveStats struct {
	Count    int
	Mean     float64
	Std      float64
	Min      float64
	Q25      float64
	Median   float64
	Q75      float64
	Max      float64
	Skewness float64
	Kurtosis float64
}

DescriptiveStats contains summary statistics for a dataset.

func Describe

func Describe(values []float64) DescriptiveStats

Describe returns comprehensive descriptive statistics.

Directories

Path Synopsis
Package distributions provides probability distributions.
Package distributions provides probability distributions.
Package hypothesis provides statistical hypothesis tests.
Package hypothesis provides statistical hypothesis tests.

Jump to

Keyboard shortcuts

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