Solved – Harmonic mean minimizes sum of squared relative errors

errorharmonic meanmeanreferencesweighted-regression

I am looking for a reference where it is proven that the harmonic mean

$$\bar{x}^h = \frac{n}{\sum_{i=1}^n \frac{1}{x_i}}$$

minimizes ( in $z$) the sum of squared relative errors

$$\sum_{i=1}^n \left( \frac{(x_i – z)^2}{x_i}\right).$$

Best Answer

You could point out that this is a weighted least squares regression with weights $1/x_i$.

To make the connection with the references, revert to a standard notation in which you seek to find $\beta$ that minimizes $$\sum \omega_i (y_i - \beta)^2.$$

This is a model with a single constant regressor $$X = \pmatrix{1\\1\\\vdots\\1}$$ and weights matrix $$W = \pmatrix{\omega_1 & 0 & \cdots & 0 \\ 0 & \omega_2 & \cdots & 0 \\\vdots & \vdots & \ddots & 0 \\ 0 & \cdots & 0 & \omega_n}.$$

I have renamed "$x_i$" as "$y_i$" (the "response") and the parameter to be estimated is $\beta$ instead of $z$. The weights are $\omega_i=1/x_i$. It is necessary that they all exceed $0$. The solution is

$$\hat\beta = (X^\prime W X)^{-1}X^\prime W y = \frac{\sum_i x_i\omega_i }{\sum_i \omega_i} = \frac{\sum_i x_i/x_i }{\sum_i 1/x_i} = \frac{n}{\sum 1/x_i},$$

QED.


Comments

  1. The same analysis applies to any positive sets of weights, providing a generalization of the harmonic mean and a useful way to characterize it.

  2. When, as in a controlled experiment, the $x_i$ are viewed as fixed (and not random), the machinery of weighted least squares provides confidence intervals and prediction intervals, etc. In other words, casting the problem into this setting automatically gives you a way to assess the precision of the harmonic mean.

  3. Viewing the harmonic mean as the solution to a weighted problem provides insight into its nature and, especially, to its sensitivity to the data. It is now clear that the most important contributors are those with the smallest values of $x_i$--and their importance has been quantified by the weights matrix $W$.

Reference

Douglas C. Montgomery, Elizabeth A. Peck, and G. Geoffrey Vining, Introduction to Linear Regression Analysis. Fifth Edition. J. Wiley, 2012. Section 5.5.2.

Related Question