Skip to content

Instantly share code, notes, and snippets.

@krishnanraman
Created January 30, 2014 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krishnanraman/8700480 to your computer and use it in GitHub Desktop.
Save krishnanraman/8700480 to your computer and use it in GitHub Desktop.
def variance(d:Data) = {
val mu = mean(d)
mean(d.map(i => (i-mu)*(i-mu)))
}
def stdev(d:Data) = math.sqrt(variance(d))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment