Statistics.Correlation

statistics-0.16.3.0: A library of statistical types, data, and functions

Safe Haskell | None
Language | Haskell2010

Statistics.Correlation

Contents

- Pearson correlation
- Spearman correlation

Description

Synopsis

- pearson :: Vector v (Double, Double) => v (Double, Double) -> Double
- pearson2 :: Vector v Double => v Double -> v Double -> Double
- pearsonMatByRow :: Matrix -> Matrix
- spearman :: (Ord a, Ord b, Vector v a, Vector v b, Vector v (a, b), Vector v Int, Vector v (Int, a), Vector v (Int, b)) => v (a, b) -> Double
- spearman2 :: (Ord a, Ord b, Vector v a, Vector v b, Vector v Int, Vector v (Int, a), Vector v (Int, b)) => v a -> v b -> Double
- spearmanMatByRow :: Matrix -> Matrix

# Pearson correlation

pearson :: Vector v (Double, Double) => v (Double, Double) -> Double #

Pearson correlation for sample of pairs. Exactly same as `correlation`

pearson2 :: Vector v Double => v Double -> v Double -> Double #

Pearson correlation for sample of pairs. Exactly same as `correlation`

pearsonMatByRow :: Matrix -> Matrix #

Compute pairwise Pearson correlation between rows of a matrix

# Spearman correlation

spearman :: (Ord a, Ord b, Vector v a, Vector v b, Vector v (a, b), Vector v Int, Vector v (Int, a), Vector v (Int, b)) => v (a, b) -> Double #

Compute Spearman correlation between two samples

spearman2 :: (Ord a, Ord b, Vector v a, Vector v b, Vector v Int, Vector v (Int, a), Vector v (Int, b)) => v a -> v b -> Double #

Compute Spearman correlation between two samples. Samples must have same length.

spearmanMatByRow :: Matrix -> Matrix #

compute pairwise Spearman correlation between rows of a matrix