1
$\begingroup$

There's live feed from ~30 exchanges http://www.coinparator.com/live/BTC/USD/ I'm calculating and displaying average of all prices (on the top, orange box).

Problem is, that usually one or two exchanges have too extreme prices (too low, too high). While 28 exchanges are trading around \$9500, one or two exchanges are trading at \$7000. Which will affect my average result.

Is there some mathematics formula, that would give less importance to values, that are too extreme?

$\endgroup$
  • 2
    $\begingroup$ If there are exchanges at 7000 and 9500, you shouldn't be averaging, you should be arbitraging. Buy at the 7000 exchange and sell at 9500. $\endgroup$ – Ross Millikan Nov 27 '17 at 4:06
2
$\begingroup$

One way would be to use the median instead of the mean. The median is less sensitive to outliers.

If you insist on using the mean, you can find the interquartile range (or the middle X% percent of your data, in general), and only calculate the mean of the points that fall within that range. You will be throwing data out which may be uncomfortable, but you've already said you're willing to discount outliers at least partially.

$\endgroup$
  • 1
    $\begingroup$ Your suggestion produces a 25% trimmed mean (i.e. throw out smallest 25% and largest 25% of the data). One could also compute an $x\%$ trimmed mean, where $x\in [0,50)$. A 0% trimmed mean is just the usual mean, and a 50% trimmed mean (really, ($50-\varepsilon$)% is just the median. Both 5% and 10% trimmed means seem to be fairly common in applications (says the pure math guy). $\endgroup$ – Xander Henderson Nov 27 '17 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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