hstats-0.3.0.1: Statistical Computing in Haskell

Safe HaskellSafe
LanguageHaskell98

Math.Statistics

Contents

Synopsis

Different mean variants

mean :: Fractional a => [a] -> a Source

Numerically stable mean

meanWgh :: Floating a => [(a, a)] -> a Source

Mean with weight. First element in tuple is element, second its weight

average :: Fractional a => [a] -> a Source

Same as mean

harmean :: Fractional a => [a] -> a Source

Harmonic mean

geomean :: Floating a => [a] -> a Source

Geometric mean

Variance, standard deviation and moments

stddev :: Floating a => [a] -> a Source

Unbiased estimate of standard deviation of sample

stddevp :: Floating a => [a] -> a Source

Standard deviation of population

var :: Fractional b => [b] -> b Source

Unbiased estimate of sample variance

pvar :: Fractional a => [a] -> a Source

Population variance

centralMoment :: (Fractional b, Integral t) => [b] -> t -> b Source

Central moments

devsq :: Floating a => [a] -> a Source

Returns the sum of square deviations from their sample mean.

Skewness and kurtosis

skew :: Floating b => [b] -> b Source

Calculate skew

pearsonSkew1 :: (Ord a, Floating a) => [a] -> a Source

Calculates first Pearson skewness coeffcient.

pearsonSkew2 :: (Ord a, Floating a) => [a] -> a Source

Calculate second Pearson skewness coeffcient.

kurt :: Floating b => [b] -> b Source

Kurtosis

Median, mode and quantiles

median :: (Fractional a, Ord a) => [a] -> a Source

Median

modes :: Ord a => [a] -> [(Int, a)] Source

Modes returns a sorted list of modes in descending order

mode :: Ord a => [a] -> Maybe a Source

Mode returns the mode of the list, otherwise Nothing

iqr :: [a] -> [a] Source

Interquartile range

quantile :: (Fractional b, Ord b) => Double -> [b] -> b Source

Arbitrary quantile q of an unsorted list. The quantile q of N data points is the point whose (zero-based) index in the sorted data set is closest to q(N-1).

quantileAsc :: (Fractional b, Ord b) => Double -> [b] -> b Source

As quantile specialized for sorted data

Other parameters

range :: (Num a, Ord a) => [a] -> a Source

Range

avgdev :: Floating a => [a] -> a Source

Average deviation

Covariance and corelation

covar :: Floating a => [a] -> [a] -> a Source

Sample Covariance

covMatrix :: Floating a => [[a]] -> [[a]] Source

Covariance matrix

pearson :: Floating a => [a] -> [a] -> a Source

Pearson's product-moment correlation coefficient

correl :: Floating a => [a] -> [a] -> a Source

Same as pearson

Simple regressions

linreg :: Floating b => [(b, b)] -> (b, b, b) Source

Least-squares linear regression of y against x for a collection of (x, y) data, in the form of (b0, b1, r) where the regression is y = b0 + b1 * x with Pearson coefficient r