Created
June 21, 2016 19:42
-
-
Save reportbase/33efb7dddc93d0ce632df8d9679d596a to your computer and use it in GitHub Desktop.
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
var mean = a.mean() | |
var sum = 0 | |
for (var n = 0; n < a.length; ++n) | |
sum += Math.pow(a[n]-mean,2) | |
a.deviation = Math.sqrt(sum/a.length) | |
var sum = 0 | |
for (var n = 0; n < x.length; ++n) | |
sum += (x[n]-xmean)*(y[n]-ymean) | |
var cov = sum/(x.length-1) | |
covariance[0] = cov | |
correlation[0] = cov / sx / sy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment