LoginSignup
1
0

More than 5 years have passed since last update.

分散を1回のループで求めるメモ

Last updated at Posted at 2013-05-10

分散を1回のループで求めるメモ

分散.as
for each(x in nums)
{
    s1 += x;
    s2 += x * x;
}
avg = s1 / n;
v = s2 / n - avg * avg;
return v;
標準偏差.as
return Math.sqrt(v);
偏差値.as
return (10 * (nums[i] - avg)) / Math.sqrt(v) + 50;
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0