# What is the best point forecast for gamma distributed data?

I believe that the values I am forecasting are gamma distributed with shape $$k>0$$ and scale $$\theta>0$$. I need a point forecast (i.e., a one-number summary) that minimizes the expected error. What point forecast does so, if my error measure is

1. the (mean) squared error (MSE)?
2. the (mean) absolute error (MAE)?
3. the (mean) absolute scaled error (MASE)?
4. the (mean) absolute percentage error (MAPE)?

I am asking and self-answering to have a reference for the future, since I often use this as an example to illustrate the properties of different error measures, e.g., at What are the shortcomings of the Mean Absolute Percentage Error (MAPE)? The analogous question for the lognormal distribution can be found here.

1. It is a standard result from introductory statistics that the expectation of a distribution is the one number summary that will minimize the expected squared error. The expectation of the gamma distribution with shape $$k>0$$ and scale $$\theta>0$$ is $$k\theta$$.

2. It is almost as well known that the median of a distribution is the one number summary that will minimize the expected absolute error (Hanley et al., 2001, The American Statistician).

The median of the gamma distribution has no closed form, but approximations exist. For instance, Berg & Pedersen (2006, Methods and Applications of Analysis) give an asymptotic expression for real-valued $$k\to\infty$$ and $$\theta=1$$, which works very well for any $$k\geq 1$$ and which one can multiply by $$\theta$$ to obtain the general case.

3. Since the MASE is simply a scaled MAE, the point forecast that minimizes the expected MAE will also minimize the expected MASE.

4. The MAPE is a bit more tricky. Let us consider the case that $$k>1$$. Per Gneiting (2011, JASA, p. 748 with $$\beta=-1$$), the point forecast minimizing the expected MAPE for a density $$f$$ is the median of a distribution with density proportional to $$\frac{1}{y}f(y)$$. Now, the gamma distribution with shape $$k>0$$ and scale $$\theta>0$$ has density

$$f_{k,\theta}(y) = \frac{1}{\Gamma(k)\theta^k}y^{k-1}\exp\Big(-\frac{y}{\theta}\Big).$$

Noting that

$$\frac{\Gamma(k-1)}{\Gamma(k)} = \frac{1}{k-1},$$

some calculation yields that

$$\frac{1}{y}f_{k,\theta}(y) = \frac{1}{\Gamma(k)\theta^k}y^{k-2}\exp\Big(-\frac{y}{\theta}\Big)\stackrel{!}{=} \frac{1}{(k-1)\theta}f_{k-1,\theta}(y)\propto f_{k-1,\theta}(y).$$

Thus, the density whose median minimizes the expected MAPE is itself another gamma, with shape $$k-1$$ and scale $$\theta$$.

• If $$k\geq 2$$, we can approximate its median using Berg & Pedersen (2006) as above.

• If $$1, I have not yet found a useful approximation for this median, although it seems to be positive. I have asked about this here. Of course, one can always approximate it numerically, as R's qgamma() function does.

• If $$0, the gamma distribution is well-defined, but the fractional moment of order $$-1$$ does not seem to exist. It seems like the expected MAPE is then minimized by a straight zero point forecast. To be honest, I don't have the inclination to prove this right now, but it does not look too hard.