hstatistics-0.2.3: Statistics

Portability portable provisional haskell.vivian.mcphail gmail com Safe-Infered

Numeric.Statistics

Description

Useful statistical functions

Synopsis

# Documentation

type Sample a = Vector aSource

Arguments

 :: Samples Double the dimensions of data (each vector being one dimension) -> Matrix Double the symmetric covariance matrix

the covariance matrix

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 the data to 0: (x - (mean x))

cloglog :: Floating a => a -> aSource

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

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

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's rank correlation τ

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

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

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

Arguments

 :: Integral a => a moment -> Bool calculate central moment -> Bool calculate absolute moment -> Vector Double data -> Double

the p'th moment of a vector

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

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

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's rank correlation coefficient

centre and normalise a vector