Skip to content

Instantly share code, notes, and snippets.

@samidarko
Created September 4, 2017 01:16
Show Gist options
  • Save samidarko/6bff5757395c61c44fc067dc2be3873f to your computer and use it in GitHub Desktop.
Save samidarko/6bff5757395c61c44fc067dc2be3873f to your computer and use it in GitHub Desktop.
import Data.List (genericLength)
mean xs = sum xs / genericLength xs
variance xs = (sum [ (x - m)^2 | x <- xs ]) / genericLength xs
where m = mean xs
standardDeviation xs = sqrt $ variance xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment