Definitions

# Generalized mean

A generalized mean, also known as power mean or Hölder mean, is an abstraction of the Pythagorean means including arithmetic, geometric, and harmonic means.

## Definition

If $p$ is a non-zero real number, we can define the generalized mean with exponent $p$ of the positive real numbers $x_1,dots,x_n$ as


M_p(x_1,dots,x_n) = left(frac{1}{n} cdot sum_{i=1}^n x_{i}^p right)^{1/p}.

## Properties

• Like most means, the generalized mean is a homogeneous function of its arguments $x_1,dots,x_n$. That is, if $b$ is a positive real number, then the generalized mean with exponent $p$ of the numbers $bcdot x_1,dots, bcdot x_n$ is equal to $b$ times the generalized mean of the numbers $x_1,dots, x_n$.
• Like the quasi-arithmetic means, the computation of the mean can be split into computations of equal sized sub-blocks.


M_p(x_1,dots,x_{ncdot k}) = M_p(M_p(x_1,dots,x_{k}), M_p(x_{k+1},dots,x_{2cdot k}),
`     dots,`
M_p(x_{(n-1)cdot k + 1},dots,x_{ncdot k}))

### Generalized mean inequality

In general, if $p < q$, then $M_p\left(x_1,dots,x_n\right) le M_q\left(x_1,dots,x_n\right)$ and the two means are equal if and only if $x_1 = x_2 = cdots = x_n$. This follows from the fact that

$forall pinmathbb\left\{R\right\} frac\left\{partial M_p\left(x_1,dots,x_n\right)\right\}\left\{partial p\right\}geq 0,$

which can be proved using Jensen's inequality.

In particular, for $pin\left\{-1, 0, 1\right\}$, the generalized mean inequality implies the Pythagorean means inequality as well as the inequality of arithmetic and geometric means.

## Special cases

• $lim_\left\{pto-infty\right\} M_p\left(x_1,dots,x_n\right) = min \left\{x_1,dots,x_n\right\}$ - minimum,
• $M_\left\{-1\right\}\left(x_1,dots,x_n\right) = frac\left\{n\right\}\left\{frac\left\{1\right\}\left\{x_1\right\}+dots+frac\left\{1\right\}\left\{x_n\right\}\right\}$ - harmonic mean,
• $lim_\left\{pto0\right\} M_p\left(x_1,dots,x_n\right) = sqrt\left[n\right]\left\{x_1cdotdotscdot x_n\right\}$ - geometric mean,
• $M_1\left(x_1,dots,x_n\right) = frac\left\{x_1 + dots + x_n\right\}\left\{n\right\}$ - arithmetic mean,
• $M_2\left(x_1,dots,x_n\right) = sqrt\left\{frac\left\{x_1^2 + dots + x_n^2\right\}\left\{n\right\}\right\}$ - quadratic mean,
• $lim_\left\{ptoinfty\right\} M_p\left(x_1,dots,x_n\right) = max \left\{x_1,dots,x_n\right\}$ - maximum.

## Proof of power means inequality

### Equivalence of inequalities between means of opposite signs

Suppose an average between power means with exponents p and q holds:
$sqrt\left[p\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^p\right\}leq sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}$
then:
$sqrt\left[p\right]\left\{sum_\left\{i=1\right\}^nfrac\left\{w_i\right\}\left\{x_i^p\right\}\right\}leq sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nfrac\left\{w_i\right\}\left\{x_i^q\right\}\right\}$
We raise both sides to the power of -1 (strictly decreasing function in positive reals):
$sqrt\left[-p\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^\left\{-p\right\}\right\}=sqrt\left[p\right]\left\{frac\left\{1\right\}\left\{sum_\left\{i=1\right\}^nw_ifrac\left\{1\right\}\left\{x_i^p\right\}\right\}\right\}geq sqrt\left[q\right]\left\{frac\left\{1\right\}\left\{sum_\left\{i=1\right\}^nw_ifrac\left\{1\right\}\left\{x_i^q\right\}\right\}\right\}=sqrt\left[-q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^\left\{-q\right\}\right\}$
We get the inequality for means with exponents -p and -q, and we can use the same reasoning backwards, thus proving the inequalities to be equivalent, which will be used in some of the later proofs.

### Geometric mean

For any q the inequality between mean with exponent q and geometric mean can be transformed in the following way:
$prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\} leq sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}$
$sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}leq prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\}$
(the first inequality is to be proven for positive q, and the latter otherwise)

We raise both sides to the power of q:

$prod_\left\{i=1\right\}^nx_i^\left\{w_icdot q\right\} leq sum_\left\{i=1\right\}^nw_ix_i^q$
in both cases we get the inequality between weighted arithmetic and geometric means for the sequence $x_i^q$, which can be proved by Jensen's inequality, making use of the fact the logarithmic function is concave:
$sum_\left\{i=1\right\}^nw_ilog\left(x_i\right) leq log\left(sum_\left\{i=1\right\}^nw_ix_i\right)$
$log\left(prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\}\right) leq log\left(sum_\left\{i=1\right\}^nw_ix_i\right)$
By applying (strictly increasing) exp function to both sides we get the inequality:
$prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\} leq sum_\left\{i=1\right\}^nw_ix_i$

Thus for any positive q it is true that:

$sqrt\left[-q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^\left\{-q\right\}\right\}leq prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\} leq sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}$
since the inequality holds for any q, however small, and, as will be shown later, the expressions on the left and right approximate the geometric mean better as q approaches 0, the limit of the power mean for q approaching 0 is the geometric mean:
$lim_\left\{qrightarrow 0\right\}sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^\left\{q\right\}\right\}=prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\}$

### Inequality between any two power means

We are to prove that for any p<q the following inequality holds:
$sqrt\left[p\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^p\right\}leq sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}$
if p is negative, and q is positive, the inequality is equivalent to the one proved above:
$sqrt\left[p\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^p\right\}leq prod_\left\{i=1\right\}^nx_i^\left\{w_i\right\} leqsqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}$
The proof for positive p and q is as follows: Define the following function: $f:\left\{mathbb R_+\right\}rightarrow\left\{mathbb R_+\right\},$ $f\left(x\right)=x^\left\{frac\left\{q\right\}\left\{p\right\}\right\}$. f is a power function, so it does have a second derivative: $f$(x)=(frac{q}{p})(frac{q}{p}-1)x^{frac{q}{p}-2}, which is strictly positive within the domain of f, since q > p, so we know f'' is convex.

Using this, and the Jensen's inequality we get:

$f\left(sum_\left\{i=1\right\}^nw_ix_i^p\right)leqsum_\left\{i=1\right\}^nw_if\left(x_i^p\right)$
$sqrt\left[frac\left\{p\right\}\left\{q\right\}\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^p\right\}leqsum_\left\{i=1\right\}^nw_ix_i^q$
after raising both side to the power of 1/q (an increasing function, since 1/q is positive) we get the inequality which was to be proven:
$sqrt\left[p\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^p\right\}leqsqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}$

Using the previously shown equivalence we can prove the inequality for negative p and q by substituting them with, respectively, -q and -p, QED.

### Minimum and maximum

Minimum and maximum are assumed to be the power means with exponents of $-infty$ and $+infty$. Thus for any q:
$min \left(x_1,x_2,ldots ,x_n\right)leq sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}leq max \left(x_1,x_2,ldots ,x_n\right)$
For maximum the proof is as follows: Assume WLoG that the sequence xi is nonincreasing and no weight is zero.

Then the inequality is equivalent to:

$sqrt\left[q\right]\left\{sum_\left\{i=1\right\}^nw_ix_i^q\right\}leq x_1$
After raising both sides to the power of q we get (depending on the sign of q) one of the inequalities:
$sum_\left\{i=1\right\}^nw_ix_i^qleq \left\{color\left\{red\right\} geq\right\} x_1^q$
≤ for q>0, ≥ for q<0.

After subtracting $w_1x_1$ from the both sides we get:

$sum_\left\{i=2\right\}^nw_ix_i^qleq \left\{color\left\{red\right\} geq\right\} \left(1-w_1\right)x_1^q$
After dividing by $\left(1-w_1\right)$:
$sum_\left\{i=2\right\}^nfrac\left\{w_i\right\}\left\{\left(1-w_1\right)\right\}x_i^qleq \left\{color\left\{red\right\} geq\right\} x_1^q$
1 - w1 is nonzero, thus:
$sum_\left\{i=2\right\}^nfrac\left\{w_i\right\}\left\{\left(1-w_1\right)\right\}=1$
Substacting x1q leaves:
$sum_\left\{i=2\right\}^nfrac\left\{w_i\right\}\left\{\left(1-w_1\right)\right\}\left(x_i^q-x_1^q\right)leq \left\{color\left\{red\right\} geq\right\} 0$
which is obvious, since x1 is greater or equal to any xi, and thus:
$x_i^q-x_1^qleq \left\{color\left\{red\right\} geq\right\} 0$

For minimum the proof is almost the same, only instead of x1, w1 we use xn, wn, QED.

## Generalized $f$-mean

The power mean could be generalized further to the generalized $f$-mean:

$M_f\left(x_1,dots,x_n\right) = f^\left\{-1\right\}$
left({frac{1}{n}cdotsum_{i=1}^n{f(x_i)}}right)

which covers e.g. the geometric mean without using a limit. The power mean is obtained for $fleft\left(xright\right)=x^p$.

## Applications

### Signal processing

A power mean serves a non-linear moving average which is shifted towards small signal values for small $p$ and emphasizes big signal values for big $p$. Given an efficient implementation of a moving arithmetic mean called smooth you can implement a moving power mean according to the following Haskell code.

` powerSmooth :: Floating a => ([a] -> [a]) -> a -> [a] -> [a]`
` powerSmooth smooth p =`
`    map (** recip p) . smooth . map (**p)`