Module math.stats stdlib

math.stats
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
1
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

  • Standard Library

Imported by

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn absdev[T]

inline
fn absdev[T](data []T) T

absdev calculates the average distance between each data point and the mean Based on https://en.wikipedia.org/wiki/Average_absolute_deviation

#fn absdev_mean[T]

fn absdev_mean[T](data []T, mean T) T

absdev_mean calculates the average distance between each data point and the provided mean Based on https://en.wikipedia.org/wiki/Average_absolute_deviation

#fn covariance[T]

inline
fn covariance[T](data1 []T, data2 []T) T

covariance calculates directional association between datasets positive value denotes variables move in same direction and negative denotes variables move in opposite directions

#fn covariance_mean[T]

fn covariance_mean[T](data1 []T, data2 []T, mean1 T, mean2 T) T

covariance_mean computes the covariance of a dataset with means provided the recurrence relation

#fn freq[T]

fn freq[T](data []T, val T) int

freq calculates the Measure of Occurance Frequency of a given number Based on https://www.mathsisfun.com/data/frequency-distribution.html

#fn geometric_mean[T]

fn geometric_mean[T](data []T) T

geometric_mean calculates the central tendency of the given input array, product(data)**1/data.len Based on https://www.mathsisfun.com/numbers/geometric-mean.html

#fn harmonic_mean[T]

fn harmonic_mean[T](data []T) T

harmonic_mean calculates the reciprocal of the average of reciprocals of the given input array Based on https://www.mathsisfun.com/numbers/harmonic-mean.html

#fn kurtosis[T]

inline
fn kurtosis[T](data []T) T

kurtosis calculates the measure of the 'tailedness' of the data by finding mean and standard of deviation

#fn kurtosis_mean_stddev[T]

fn kurtosis_mean_stddev[T](data []T, mean T, sd T) T

kurtosis_mean_stddev calculates the measure of the 'tailedness' of the data using the fourth moment the deviations, normalized by the sd

#fn lag1_autocorrelation[T]

inline
fn lag1_autocorrelation[T](data []T) T

lag1_autocorrelation_mean calculates the correlation between values that are one time period apart of a dataset, based on the mean

#fn lag1_autocorrelation_mean[T]

fn lag1_autocorrelation_mean[T](data []T, mean T) T

lag1_autocorrelation_mean calculates the correlation between values that are one time period apart of a dataset, using the recurrence relation

#fn max[T]

fn max[T](data []T) T

max finds the maximum value from the dataset

#fn max_index[T]

fn max_index[T](data []T) int

max_index finds the first index of the maximum value

#fn mean[T]

fn mean[T](data []T) T

mean calculates the average of the given input array, sum(data)/data.len Based on https://www.mathsisfun.com/data/central-measures.html

#fn median[T]

fn median[T](sorted_data []T) T

median returns the middlemost value of the given input array ( input array is assumed to be sorted ) Based on https://www.mathsisfun.com/data/central-measures.html

#fn min[T]

fn min[T](data []T) T

min finds the minimum value from the dataset

#fn min_index[T]

fn min_index[T](data []T) int

min_index finds the first index of the minimum value

#fn minmax[T]

fn minmax[T](data []T) (T, T)

minmax finds the minimum and maximum value from the dataset

#fn minmax_index[T]

fn minmax_index[T](data []T) (int, int)

minmax_index finds the first index of the minimum and maximum value

#fn mode[T]

fn mode[T](data []T) T

mode calculates the highest occuring value of the given input array Based on https://www.mathsisfun.com/data/central-measures.html

#fn population_stddev[T]

inline
fn population_stddev[T](data []T) T

population_stddev calculates how spread out the dataset is Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn population_stddev_mean[T]

inline
fn population_stddev_mean[T](data []T, mean T) T

population_stddev_mean calculates how spread out the dataset is, with the provide mean Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn population_variance[T]

inline
fn population_variance[T](data []T) T

population_variance is the Measure of Dispersion / Spread of the given input array Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn population_variance_mean[T]

fn population_variance_mean[T](data []T, mean T) T

population_variance_mean is the Measure of Dispersion / Spread of the given input array, with the provided mean Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn quantile[T]

fn quantile[T](sorted_data []T, f T) T

#fn range[T]

fn range[T](data []T) T

range calculates the difference between the min and max Range ( Maximum - Minimum ) of the given input array Based on https://www.mathsisfun.com/data/range.html

#fn rms[T]

fn rms[T](data []T) T

rms, Root Mean Square, calculates the sqrt of the mean of the squares of the given input array Based on https://en.wikipedia.org/wiki/Root_mean_square

#fn sample_stddev[T]

inline
fn sample_stddev[T](data []T) T

Measure of Dispersion / Spread Sample Standard Deviation of the given input array Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn sample_stddev_mean[T]

inline
fn sample_stddev_mean[T](data []T, mean T) T

Measure of Dispersion / Spread Sample Standard Deviation of the given input array Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn sample_variance[T]

inline
fn sample_variance[T](data []T) T

sample_variance calculates the spread of dataset around the mean Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn sample_variance_mean[T]

fn sample_variance_mean[T](data []T, mean T) T

sample_variance calculates the spread of dataset around the provided mean Based on https://www.mathsisfun.com/data/standard-deviation.html

#fn skew[T]

inline
fn skew[T](data []T) T

skew calculates the mean and standard of deviation to find the skew from the data

#fn skew_mean_stddev[T]

fn skew_mean_stddev[T](data []T, mean T, sd T) T

skew_mean_stddev calculates the skewness of data

#fn tss[T]

inline
fn tss[T](data []T) T

tts, Sum of squares, calculates the sum over all squared differences between values and overall mean

#fn tss_mean[T]

fn tss_mean[T](data []T, mean T) T

tts_mean, Sum of squares, calculates the sum over all squared differences between values and the provided mean

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.