Lehmer mean

From HandWiki
Short description: Mathematic formula for deriving a mean

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

[math]\displaystyle{ L_p(\mathbf{x}) = \frac{\sum_{k=1}^n x_k^p}{\sum_{k=1}^n x_k^{p-1}}. }[/math]

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

[math]\displaystyle{ L_{p,w}(\mathbf{x}) = \frac{\sum_{k=1}^n w_k\cdot x_k^p}{\sum_{k=1}^n w_k\cdot x_k^{p-1}}. }[/math]

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 [math]\displaystyle{ p \mapsto L_p(\mathbf{x}) }[/math] is non-negative

[math]\displaystyle{ \frac{\partial}{\partial p} L_p(\mathbf{x}) = \frac {\left(\sum_{j=1}^n \sum_{k=j+1}^n \left[x_j - x_k\right] \cdot \left[\ln(x_j) - \ln(x_k)\right] \cdot \left[x_j \cdot x_k\right]^{p-1}\right)} {\left(\sum_{k=1}^n x_k^{p-1}\right)^2}, }[/math]

thus this function is monotonic and the inequality

[math]\displaystyle{ p \le q \Longrightarrow L_p(\mathbf{x}) \le L_q(\mathbf{x}) }[/math]

holds.

The derivative of the weighted Lehmer mean is:

[math]\displaystyle{ \frac{\partial L_{p,w}(\mathbf{x})}{\partial p} = \frac{(\sum w x^{p-1})(\sum wx^p\ln{x}) - (\sum wx^p)(\sum wx^{p-1}\ln{x})}{(\sum wx^{p-1})^2} }[/math]

Special cases

  • [math]\displaystyle{ \lim_{p \to -\infty} L_p(\mathbf{x}) }[/math] is the minimum of the elements of [math]\displaystyle{ \mathbf{x} }[/math].
  • [math]\displaystyle{ L_0(\mathbf{x}) }[/math] is the harmonic mean.
  • [math]\displaystyle{ L_\frac{1}{2}\left((x_1, x_2)\right) }[/math] is the geometric mean of the two values [math]\displaystyle{ x_1 }[/math] and [math]\displaystyle{ x_2 }[/math].
  • [math]\displaystyle{ L_1(\mathbf{x}) }[/math] is the arithmetic mean.
  • [math]\displaystyle{ L_2(\mathbf{x}) }[/math] is the contraharmonic mean.
  • [math]\displaystyle{ \lim_{p \to \infty} L_p(\mathbf{x}) }[/math] is the maximum of the elements of [math]\displaystyle{ \mathbf{x} }[/math].
    Sketch of a proof: Without loss of generality let [math]\displaystyle{ x_1,\dots,x_k }[/math] be the values which equal the maximum. Then [math]\displaystyle{ L_p(\mathbf{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}} }[/math]

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 [math]\displaystyle{ p }[/math] and emphasizes big signal values for big [math]\displaystyle{ p }[/math]. 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))

Gonzalez and Woods call this a "contraharmonic mean filter" described for varying values of p (however, as above, the contraharmonic mean can refer to the specific case [math]\displaystyle{ p = 2 }[/math]). Their convention is to substitute p with the order of the filter Q:

[math]\displaystyle{ f(x) = \frac{\sum_{k=1}^n x_k^{Q+1}}{\sum_{k=1}^n x_k^Q}. }[/math]

Q=0 is the arithmetic mean. Positive Q can reduce pepper noise and negative Q can reduce salt noise.[2]

See also

Notes

  1. P. S. Bullen. Handbook of means and their inequalities. Springer, 1987.
  2. Gonzalez, Rafael C.; Woods, Richard E. (2008). "Chapter 5 Image Restoration and Reconstruction". Digital Image Processing (3 ed.). Prentice Hall. ISBN 9780131687288. http://www.imageprocessingplace.com/DIP-3E/dip3e_main_page.htm. 

External links