Search Postgresql Archives

Re: Q:Aggregrating Weekly Production Data. How do you do it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ow Mun Heng wrote:

The results are valid (verified with actual data) but I don't understand
the logic. All the Statistical books I've read marked stdev as sqrt
(sum(x - ave(x))^2 / (n - 1). The formula is very different, hence the
confusion.

A formula is not an algorithm. In particular, the naive way of calculating variance or standard deviation has massive numerical instability problems - anything involving sums of squares does. There are a variety of alternate algorithms for stddev/variance, I presume your other algorithm is similarly trying to avoid these same issues (but I have not looked closely at it). You can also see Wikipedia for one of the most well known, due to Knuth/Wellford:

  http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance

- John D. Burger
  MITRE



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux