hstatistics-0.2.5.4: Statistics

Copyright(c) A. V. H. McPhail 2010 2012 2014
LicenseBSD3
Maintainerhaskell.vivian.mcphail <at> gmail <dot> com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Numeric.Statistics

Description

Useful statistical functions

Synopsis

Documentation

type Sample a = Vector a Source #

covarianceMatrix Source #

Arguments

:: Samples Double

the dimensions of data (each vector being one dimension)

-> Matrix Double

the symmetric covariance matrix

the covariance matrix

correlationCoefficientMatrix :: Samples Double -> Matrix Double Source #

the correlation coefficient: (cov x y) / (std x) (std y)

meanList :: (Container Vector a, Num (Vector a), Fractional a) => [Sample a] -> Sample a Source #

the mean of a list of vectors

meanArray :: (Container Vector a, Num (Vector a), Fractional a) => Samples a -> Sample a Source #

the mean of an array of vectors

meanMatrix :: (Container Vector a, Num (Vector a), Fractional a) => Matrix a -> Sample a Source #

the mean of a matrix with data series in rows

varianceList :: (Container Vector a, Floating (Vector a), Num a, Fractional a) => [Sample a] -> Sample a Source #

the variance of a list of vectors

varianceArray :: (Container Vector a, Floating (Vector a), Fractional a) => Samples a -> Sample a Source #

the variance of an array of vectors

varianceMatrix :: (Container Vector a, Floating (Vector a), Fractional a) => Matrix a -> Sample a Source #

the variance of a matrix with data series in rows

centre :: Vector Double -> Vector Double Source #

centre the data to 0: (x - (mean x))

cloglog :: Floating a => a -> a Source #

complementary log-log function cloglog :: Vector Double -> Vector Double

corcoeff :: Vector Double -> Vector Double -> Double Source #

corcoeff = covariance x / (std dev x * std dev y)

cut Source #

Arguments

:: Vector Double 
-> Vector Double

intervals

-> Vector Int

data indexed by bin

cut numerical data into intervals, data must fall inside the bounds

ranks :: (Fractional b, Storable b) => Vector Double -> Vector b Source #

return the rank of each element of the vector multiple identical entries result in the average rank of those entries ranks :: Vector Double -> Vector Double

kendall :: Vector Double -> Vector Double -> Matrix Double Source #

kendall's rank correlation τ

logit :: (Floating b, Storable b) => Vector b -> Vector b Source #

(logit p) = log(p/(1-p)) logit :: Vector Double -> Vector Double

mahalanobis Source #

Arguments

:: Samples Double

the data set

-> Maybe (Sample Double)

(Just sample) to be measured or use mean when Nothing

-> Double

D^2

the Mahalanobis D-square distance between samples columns are components and rows are observations (uses pseudoinverse)

mode :: Vector Double -> [(Double, Integer)] Source #

a list of element frequencies

moment Source #

Arguments

:: Integral a 
=> a

moment

-> Bool

calculate central moment

-> Bool

calculate absolute moment

-> Vector Double

data

-> Double 

the p'th moment of a vector

ols Source #

Arguments

:: (Num (Vector t), Field t) 
=> Matrix t

X

-> Matrix t

Y

-> (Matrix t, Matrix t, Matrix t)

(OLS estimator for B, OLS estimator for s, OLS residuals)

ordinary least squares estimation for the multivariate model Y = X B + e rows are observations, columns are elements mean e = 0, cov e = kronecker s I

percentile Source #

Arguments

:: Double

percentile (0 - 100)

-> Vector Double

data

-> Double

result

compute quantiles in percent

range :: (Container c e, Num e) => c e -> e Source #

the difference between the maximum and minimum of the input

run_count Source #

Arguments

:: (Num a, Num t, Ord b, Ord a, Container Vector b) 
=> a

longest run to count

-> Vector b

data

-> [(a, t)]
(run length,count)

count the number of runs greater than or equal to n in the data

spearman :: Vector Double -> Vector Double -> Double Source #

Spearman's rank correlation coefficient

studentize :: Vector Double -> Vector Double Source #

centre and normalise a vector