3
$\begingroup$

I believe that the values I am forecasting are lognormally distributed with log-mean $\mu$ and log-variance $\sigma^2$. 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 gamma distribution can be found here.

$\endgroup$
2
$\begingroup$
  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 lognormal distribution with log-mean $\mu$ and log-variance $\sigma^2$ is $\exp\big(\mu+\frac{\sigma^2}{2}\big)$.

  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 lognormal distribution with log-mean $\mu$ and log-variance $\sigma^2$ is $\exp(\mu)$.

  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. 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 lognormal distribution with log-mean $\mu$ and log-variance $\sigma^2$ is $\exp(\mu)$ has density

    $$ f(y) = \frac{1}{y\sigma\sqrt{2\pi}}\exp\bigg(-\frac{(\ln y-\mu)^2}{2\sigma^2}\bigg). $$

    Therefore the density we are interested in is

    $$ \frac{1}{y}f(y) = \frac{1}{y^2\sigma\sqrt{2\pi}}\exp\bigg(-\frac{(\ln y-\mu)^2}{2\sigma^2}\bigg)\propto\frac{1}{y^2}\exp\bigg(-\frac{(\ln y-\mu)^2}{2\sigma^2}\bigg). $$

    (Since we are only interested in the distribution up to a proportionality factor, we can disregard the constant multiplier.)

    Now, set

    $$ m := \exp(\mu-\sigma^2). $$

    We claim that $m$ is the median of $\frac{1}{y}f(y)$, i.e., the point forecast minimizing the expected MAPE, which we were looking for. (Coincidentally, $m$ is also the mode of the original lognormal distribution. This relationship does not hold for other strictly positive distributions, e.g., the gamma.)

    To prove that $m$ is the median we are looking for, we note that

    $$ \int_a^b \frac{1}{y^2}\exp\bigg(-\frac{(\ln y-\mu)^2}{2\sigma^2}\bigg)\,dy = \sqrt{\frac{\pi}{2}}\sigma\exp\Big(\frac{\sigma^2}{2-\mu}\Big)\text{erf}\bigg(\frac{-\mu+\sigma^2+\ln y}{\sqrt{2}\sigma}\bigg)\bigg|_{y=a}^b, $$

    where $\text{erf}$ denotes the error function, which has the following properties:

    $$ \lim_{x\to-\infty}\text{erf}(x)=-1, \quad\text{erf}(0)=0, \quad \lim_{x\to\infty}\text{erf}(x)=1. $$

    Substituting the limits into the integral, we obtain that

    $$ \int_0^m\frac{1}{y^2}\exp\bigg(-\frac{(\ln y-\mu)^2}{2\sigma^2}\bigg)\,dy=\int_m^\infty\frac{1}{y^2}\exp\bigg(-\frac{(\ln y-\mu)^2}{2\sigma^2}\bigg)\,dy. $$

    Since the proportionality factors do not involve $m$, this yields that

    $$ \int_0^m \frac{1}{y}f(y)\,dy = \int_m^\infty \frac{1}{y}f(y)\,dy $$

    as required.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.