hstatistics-0.2.3: Statistics

Portabilityportable
Stabilityprovisional
Maintainerhaskell.vivian.mcphail <at> gmail <dot> com
Safe HaskellSafe-Infered

Numeric.Statistics

Description

Useful statistical functions

Synopsis

Documentation

type Sample a = Vector aSource

covarianceMatrixSource

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 DoubleSource

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

meanList :: (Container Vector a, Num (Vector a)) => [Sample a] -> Sample aSource

the mean of a list of vectors

meanArray :: (Container Vector a, Num (Vector a)) => Samples a -> Sample aSource

the mean of an array of vectors

meanMatrix :: (Container Vector a, Num (Vector a), Element a) => Matrix a -> Sample aSource

the mean of a matrix with data series in rows

varianceList :: (Container Vector a, Floating (Vector a)) => [Sample a] -> Sample aSource

the variance of a list of vectors

varianceArray :: (Container Vector a, Floating (Vector a)) => Samples a -> Sample aSource

the variance of an array of vectors

varianceMatrix :: (Container Vector a, Floating (Vector a), Element a) => Matrix a -> Sample aSource

the variance of a matrix with data series in rows

centre :: Vector Double -> Vector DoubleSource

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

cloglog :: Floating a => a -> aSource

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

corcoeff :: Vector Double -> Vector Double -> DoubleSource

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

cutSource

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 bSource

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 DoubleSource

kendall's rank correlation τ

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

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

mahalanobisSource

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

momentSource

Arguments

:: Integral a 
=> a

moment

-> Bool

calculate central moment

-> Bool

calculate absolute moment

-> Vector Double

data

-> Double 

the p'th moment of a vector

olsSource

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

percentileSource

Arguments

:: Double

percentile (0 - 100)

-> Vector Double

data

-> Double

result

compute quantiles in percent

range :: Container c e => c e -> eSource

the difference between the maximum and minimum of the input

run_countSource

Arguments

:: (Num a, Num t, Ord b, Ord a, Storable 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 -> DoubleSource

Spearman's rank correlation coefficient

studentize :: Vector Double -> Vector DoubleSource

centre and normalise a vector