Portability | portable |
---|---|
Stability | provisional |
Maintainer | haskell.vivian.mcphail <at> gmail <dot> com |
Safe Haskell | None |
Useful statistical functions
- type Sample a = Vector a
- type Samples a = Array Int (Vector a)
- covarianceMatrix :: Samples Double -> Matrix Double
- correlationCoefficientMatrix :: Samples Double -> Matrix Double
- meanList :: (Container Vector a, Num (Vector a)) => [Sample a] -> Sample a
- meanArray :: (Container Vector a, Num (Vector a)) => Samples a -> Sample a
- meanMatrix :: (Container Vector a, Num (Vector a), Element a) => Matrix a -> Sample a
- varianceList :: (Container Vector a, Floating (Vector a)) => [Sample a] -> Sample a
- varianceArray :: (Container Vector a, Floating (Vector a)) => Samples a -> Sample a
- varianceMatrix :: (Container Vector a, Floating (Vector a), Element a) => Matrix a -> Sample a
- centre :: Vector Double -> Vector Double
- cloglog :: Floating a => a -> a
- corcoeff :: Vector Double -> Vector Double -> Double
- cut :: Vector Double -> Vector Double -> Vector Int
- ranks :: (Fractional b, Storable b) => Vector Double -> Vector b
- kendall :: Vector Double -> Vector Double -> Matrix Double
- logit :: (Floating b, Storable b) => Vector b -> Vector b
- mahalanobis :: Samples Double -> Maybe (Sample Double) -> Double
- mode :: Vector Double -> [(Double, Integer)]
- moment :: Integral a => a -> Bool -> Bool -> Vector Double -> Double
- ols :: (Num (Vector t), Field t) => Matrix t -> Matrix t -> (Matrix t, Matrix t, Matrix t)
- percentile :: Double -> Vector Double -> Double
- range :: Container c e => c e -> e
- run_count :: (Num a, Num t, Ord b, Ord a, Storable b) => a -> Vector b -> [(a, t)]
- spearman :: Vector Double -> Vector Double -> Double
- studentize :: Vector Double -> Vector Double
Documentation
:: 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
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)
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
logit :: (Floating b, Storable b) => Vector b -> Vector bSource
(logit p) = log(p/(1-p)) logit :: Vector Double -> Vector Double
:: 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)
:: Integral a | |
=> a | moment |
-> Bool | calculate central moment |
-> Bool | calculate absolute moment |
-> Vector Double | data |
-> Double |
the p'th moment of a vector
:: (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
compute quantiles in percent