Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


A whole lot of DEVIATION

This topic is 6188 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Let standard deviation = sqrt((sum(x^2) - sum(x)^2)/n) Anyone have a good algorithm for calculating Standard Devatiion "on the fly" so that you don''t overflow on summing the x^2? Thanks, Steve

Share this post

Link to post
Share on other sites

Isn't your formula a bit wrong?
Shouldn't it be:
std = sqrt(1/sqrt(N-1)) * sqrt( sum(x^2)- sum(x)^2/N )

N = [total number of observations]

Anyway, why don't you use this formula:
std = 1/sqrt(N-1) * sum((x(i) - mean(x))^2)
where x(i) is the i:th element.

Then you ought not to get an overflow.

/Mankind gave birth to God.

Edited by - silvren on December 31, 2001 3:31:36 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!