Skip to content

Instantly share code, notes, and snippets.

View gavinwhyte's full-sized avatar

Gavin Whyte gavinwhyte

View GitHub Profile
@gavinwhyte
gavinwhyte / gist:7023ccf7a272179bdaab
Last active September 7, 2015 05:52
Pearson Correlation Coefficient.
-- Create a new file, which we will call Main.hs
main :: IO ()
main = do
let d1 = [3,3,3,4,4,4,5,5,5]
let d2 = [1,1,2,2,3,4,4,5,5]
let r = pearson d1 d2
print r
pearson xs ys = (n * sumXY - sumX * sumY) /