# Function similar to arithmetic mean that amplifies outliers?

This is kind of an odd question, and I'm not well educated in math, but bear with me.

I need a procedure similar to taking the average of a bunch of numbers, except I want large changes in one of the values in the input to cause a larger change in the output than you get with normal arithmetic mean.

Basically I want {2, 2, 2, 5} to "average" to something a little bit more than 3, and {2, 2, 2, 100} to "average" to something a lot more than 26.5.

Does that make sense? Is there a function that behaves like this?

• Can I ask why you need this? Nov 14, 2015 at 0:59
• @BenLongo Basically, I need a set of pixels to have colors "flow" through them. The way I have it now, each pixel's color is the average of the color of all adjacent pixels. The trouble is that changes in color are nullified more quickly than I want. Nov 14, 2015 at 1:26
• Interesting, have you looked into using something like a Gaussian matrix for weights? You may also want to check this out. Nov 14, 2015 at 1:51

$$\sqrt{\frac{1}{4}(2^2+2^2+2^2+5^2)}\approx 3.04$$
$$\sqrt{\frac{1}{4}(2^2+2^2+2^2+100^2)}\approx 50.03$$
This is an example of a power mean. $m=2$ gives the above, $m=1$ gives the arithmetic mean. If you want more extreme means, just let $m$ get larger.