0
$\begingroup$

I'm sure there's a name for this concept, but I can't find it (I'm not familiar with statistical terms):

Suppose I have a series of numbers, and an average of those. I'm wondering how correct this average is to predict future values. Say the average is 5, then if my series all consisted of fives, I would say that the next number in the series has a high probability of being five. But the series could just as well have been half 10:s and half 0:s (still giving an average of 5), and that would give a low probability of the next number in the series being 5. How do I calculate this, or express the distance of my series to the average?

int[] series = [5, 5, 5, 5, 5, 5]; //avg is 5, series is close to avg
int[] series = [10, 10, 10, 0, 0, 0] //avg is 5, series is far from avg

A calculation like this would give some indication of how much the series values differs from the average. The blue box is what I'm looking to calculate or find a name for (it's the average difference expressed as a multiple of the average).

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ What do you mean by distance to the avg..? The simplest answer is variance, but you can easily imagine examples that show how it fails, similar to your examples. So how exactly would you imagine it to work? $\endgroup$
    – Tim
    Commented Aug 18, 2016 at 10:21
  • $\begingroup$ While it seems like variance might be what im looking for, i cant make much sense of the formulas at the wikipedia page. Thinking about it, i could calculate each absolute difference between the series entry and the total average, and then average those and then express this as a multiple of the average. Ill update the question with an example $\endgroup$ Commented Aug 18, 2016 at 12:28
  • $\begingroup$ Why you want to take mean of absolute differences rather then variance? Actually, variance penalizes extreme cases more then taking absolute values (see stats.stackexchange.com/questions/118/… ) $\endgroup$
    – Tim
    Commented Aug 18, 2016 at 12:53
  • $\begingroup$ Okay, seems like its either standard deviation or variance im looking for. The wikipedia article gives a simpler to follow explanation and calculation of those terms. Thaks @Tim for the replies, post it as an answer and ill accept it $\endgroup$ Commented Aug 18, 2016 at 13:28

1 Answer 1

3
$\begingroup$

If you are looking for average distance from the mean, then the most common choice of such measure is variance. If $x_1,\dots,x_n$ is your sample and $\bar x$ is it's arithmetic mean, then we define variance as

$$ \frac{1}{n} \sum_{i=1}^n (x_i - \bar x)^2 $$

so we take average squared difference from the mean. To have your measure in the same scale as your data, you can take square root of it, i.e. calculate standard deviation.

There are also other measures as well, for example if you were working with medians, you could use more robust median absolute deviation, that is defined as

$$ \operatorname{median}\left(\ \left| X_{i} - \operatorname{median} (X) \right|\ \right) $$

However squaring the difference and using variance (or standard deviation) is preferred since it has many nice properties, what you could learn from following threads:
Why square the difference instead of taking the absolute value in standard deviation?
Why should I prefer the standard deviation over other measures of variance?
Understanding "variance" intuitively
or Why is variance calculated by squaring the deviations? thread on ResearchGate.net.

Moreover, in your case squaring penalizes the extreme outlying cases more then taking absolute value, so it better serves for your purpose.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.