Solved – Exception for sum of deviations from mean being 0

I was reading here

the sum of the deviations about the mean will be 0, except for possible rounding.

Could anyone explain me the what does it mean? I know about sum of deviations from mean being zero but what about this except for possible rounding?

When a mean is computed, it's not computed to infinite precision. As a result, the computed sum of deviations around a mean can be a little different from zero.

We can see this, for example, in R, like so:

 x <- rnorm(1000)  # generates 1000 standard normal random numbers, puts them in x  d <- x - mean(x)  # compute the deviations from the mean and put them in d  sum(d)            # add the deviations [1] 2.026851e-14 

Now $2 times 10^{-14}$ is very small… but it isn't exactly zero.

If you want to investigate in detail how finite precision computation is different from algebra, this is a handy resource.

If you compute a mean by hand and round your values off to say 3 decimal places, you'll see the same thing – frequently the sum of deviations about the mean is slightly different from zero.

Similar Posts:

Rate this post

Leave a Comment