-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Statistics -- -- Purely functional interface for statistics based on hmatrix and -- hmatrix-gsl-stats -- -- When hmatrix is installed with -fvector, the vector type is -- Data.Vector.Storable from the vector package and compatible with the -- statistics package. -- http://hackage.haskell.org/package/statistics -- -- Feature requests, suggestions, and bug fixes welcome. @package hstatistics @version 0.2.4 -- | Methods for tests using surrogate data module Numeric.Statistics.Surrogate -- | perform an analysis using surrogate data surrogate :: Int -> Int -> (Array Int (Vector Double) -> a) -> Array Int (Vector Double) -> Array Int a -- | create histograms from density functions module Numeric.Statistics.Histogram cumulativeToHistogram :: (Double -> Double) -> Vector Double -> Histogram gaussianHistogram :: Double -> Double -> Vector Double -> Histogram -- | Probability Distribution Function interface module Numeric.Statistics.PDF -- | a probability distribution function -- -- a PDF interface data PDFFunction a class PDF b a probability :: PDF b a => b -> Vector a -> Vector Double -- | create a PDF from an arbtrary function f :-> [0,1] pdfFromFunction :: (a -> Double) -> PDFFunction a instance PDF Histogram2D (Double, Double) instance PDF Histogram Double instance Storable b => PDF (PDFFunction b) b -- | Shannon entropy module Numeric.Statistics.Information -- | the entropy sum p_i lln{p_i} of a sequence entropy :: PDF a Double => a -> Vector Double -> Double -- | the mutual information sum_x sum_y p(x,y) ln{frac{p(x,y)}{p(x)p(y)}} mutual_information :: (PDF a Double, PDF b (Double, Double)) => b -> a -> a -> (Vector Double, Vector Double) -> Double -- | Useful statistical functions module Numeric.Statistics type Sample a = Vector a type Samples a = Array Int (Vector a) -- | the covariance matrix covarianceMatrix :: Samples Double -> Matrix Double -- | the correlation coefficient: (cov x y) / (std x) (std y) correlationCoefficientMatrix :: Samples Double -> Matrix Double -- | the mean of a list of vectors meanList :: (Container Vector a, Num (Vector a)) => [Sample a] -> Sample a -- | the mean of an array of vectors meanArray :: (Container Vector a, Num (Vector a)) => Samples a -> Sample a -- | the mean of a matrix with data series in rows meanMatrix :: (Container Vector a, Num (Vector a), Element a) => Matrix a -> Sample a -- | the variance of a list of vectors varianceList :: (Container Vector a, Floating (Vector a)) => [Sample a] -> Sample a -- | the variance of an array of vectors varianceArray :: (Container Vector a, Floating (Vector a)) => Samples a -> Sample a -- | the variance of a matrix with data series in rows varianceMatrix :: (Container Vector a, Floating (Vector a), Element a) => Matrix a -> Sample a -- | centre the data to 0: (x - (mean x)) centre :: Vector Double -> Vector Double -- | complementary log-log function cloglog :: Vector Double -> Vector -- Double cloglog :: Floating a => a -> a -- | corcoeff = covariance x / (std dev x * std dev y) corcoeff :: Vector Double -> Vector Double -> Double -- | cut numerical data into intervals, data must fall inside the bounds cut :: Vector Double -> Vector Double -> Vector Int -- | 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 ranks :: (Fractional b, Storable b) => Vector Double -> Vector b -- | kendall's rank correlation τ kendall :: Vector Double -> Vector Double -> Matrix Double -- | (logit p) = log(p/(1-p)) logit :: Vector Double -> Vector Double logit :: (Floating b, Storable b) => Vector b -> Vector b -- | the Mahalanobis D-square distance between samples columns are -- components and rows are observations (uses pseudoinverse) mahalanobis :: Samples Double -> Maybe (Sample Double) -> Double -- | a list of element frequencies mode :: Vector Double -> [(Double, Integer)] -- | the p'th moment of a vector moment :: Integral a => a -> Bool -> Bool -> Vector Double -> Double -- | 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 ols :: (Num (Vector t), Field t) => Matrix t -> Matrix t -> (Matrix t, Matrix t, Matrix t) -- | compute quantiles in percent percentile :: Double -> Vector Double -> Double -- | the difference between the maximum and minimum of the input range :: Container c e => c e -> e -- | count the number of runs greater than or equal to n in the -- data run_count :: (Num a, Num t, Ord b, Ord a, Storable b) => a -> Vector b -> [(a, t)] -- | Spearman's rank correlation coefficient spearman :: Vector Double -> Vector Double -> Double -- | centre and normalise a vector studentize :: Vector Double -> Vector Double -- | Principal Components Analysis module Numeric.Statistics.PCA -- | find the n principal components of multidimensional data pca :: Array Int (Vector Double) -> Double -> Matrix Double -- | perform a PCA transform of the original data (remove mean) | Final = -- M^T Data^T pcaTransform :: Array Int (Vector Double) -> Matrix Double -> Array Int (Vector Double) -- | perform a dimension-reducing PCA modification pcaReduce :: Array Int (Vector Double) -> Double -> Array Int (Vector Double) -- | Independent Components Analysis -- -- implements the FastICA algorithm found in: -- --