Created
January 18, 2015 16:20
-
-
Save JefClaes/315fa7a3b66f10e73089 to your computer and use it in GitHub Desktop.
Averages are not good enough (4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let standardDeviation input = | |
let avg = input |> Seq.average | |
let x = input |> Seq.map(fun x -> System.Math.Pow(float x - avg, float 2)) |> Seq.sum | |
let y = input |> Seq.length |> float | |
let variance = x / y | |
System.Math.Sqrt variance | |
// Average = 45.625; Standard Deviation = 20.87425148 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment