# Lehmer mean

In mathematics, the Lehmer mean of a tuple ${\displaystyle x}$ of positive real numbers, named after Derrick Henry Lehmer,[1] is defined as:

${\displaystyle L_{p}(x)={\frac {\sum _{k=1}^{n}x_{k}^{p}}{\sum _{k=1}^{n}x_{k}^{p-1}}}.}$

The weighted Lehmer mean with respect to a tuple ${\displaystyle w}$ of positive weights is defined as:

${\displaystyle L_{p,w}(x)={\frac {\sum _{k=1}^{n}w_{k}\cdot x_{k}^{p}}{\sum _{k=1}^{n}w_{k}\cdot x_{k}^{p-1}}}.}$

The Lehmer mean is an alternative to power means for interpolating between minimum and maximum via arithmetic mean and harmonic mean.

## Properties

The derivative of ${\displaystyle p\mapsto L_{p}(x)}$ is non-negative

${\displaystyle {\frac {\partial }{\partial p}}L_{p}(x)={\frac {\sum _{j=1}^{n}\sum _{k=j+1}^{n}(x_{j}-x_{k})\cdot (\ln x_{j}-\ln x_{k})\cdot (x_{j}\cdot x_{k})^{p-1}}{\left(\sum _{k=1}^{n}x_{k}^{p-1}\right)^{2}}},}$

thus this function is monotonic and the inequality

${\displaystyle p\leq q\Rightarrow L_{p}(x)\leq L_{q}(x)}$

holds.

## Special cases

Sketch of a proof: Without loss of generality let ${\displaystyle x_{1},\dots ,x_{k}}$ be the values which equal the maximum. Then ${\displaystyle L_{p}(x)=x_{1}\cdot {\frac {k+\left({\frac {x_{k+1}}{x_{1}}}\right)^{p}+\cdots +\left({\frac {x_{n}}{x_{1}}}\right)^{p}}{k+\left({\frac {x_{k+1}}{x_{1}}}\right)^{p-1}+\cdots +\left({\frac {x_{n}}{x_{1}}}\right)^{p-1}}}}$

## Applications

### Signal processing

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

 lehmerSmooth :: Floating a => ([a] -> [a]) -> a -> [a] -> [a]
lehmerSmooth smooth p xs = zipWith (/)
(smooth (map (**p) xs))
(smooth (map (**(p-1)) xs))