I just talked to someone who stated that quantiles cannot be computed for lognormal distributions. or it does not make sense.
Is this true?
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.
Sign up to join this communityI just talked to someone who stated that quantiles cannot be computed for lognormal distributions. or it does not make sense.
Is this true?
Let's start with definitions and notation. A random variable $X$ is lognormal if its natural logarithm, $Y = \log(X)$, is normal.
Denote with $M$ and $S$ the mean and standard deviation of $X$. Denote with $m$ and $s$ the mean and standard deviation of $Y$. Given $M$ and $S$, you can calculate $m$ and $s$ as: $m = \log[M^2/(M^2 + S^2)^{(1/2)}]$ and $s = (\log[(S/M)^2+1])^{(1/2)}$.
To calculate a quantile of $X$, we use the fact that the exponential function (inverse of the log function) is monotone increasing -- it maps quantiles of $Y$ into quantiles of $X$. Suppose we want to calculate the .95-quantile of $X$ (nothing special about .95, substitute any quantile you like). Let $Q$ denote the .95 quantile of $X$. Let $q$ denote the .95 quantile of $Y$. We know the mean and standard deviation, $M$ and $S$, of $X$. From these, we calculate the mean and standard deviation, $m$ and $s$, of $Y$. Since $Y$ is normal, we can easily calculate its .95 quantile $q$. The .95 quantile $Q$ of $X$ is then simply: $Q = \exp[q]$.
here is the original post by Glyn Holton: http://www.riskarchive.com/archive02_4/00000622.htm
I am not a statistician, but I am quite sure that the quantile function for the log-normal distribution is well-defined because it is the inverse of the cumulative distribution function, which is strictly increasing.
For all continuous distributions, the ICDF exists and is unique if 0 < p < 1. (source)
There is a software library (distributions-lognormal-quantile
) I have used in some applications to evaluate that function, and I believe it uses this equation:
This function is also available in Microsoft Excel as LOGNORM.INV.
Here is the proof. Take $\log X \sim \mathcal{N}(\mu, \sigma)$. Then $X$ is log-normally distributed with CDF: $$ F(x) = \frac{1}{2}\left(1 + erf \left(\frac{\log x - \mu}{\sigma \sqrt{2}} \right) \right) $$
we can now solve:
\begin{align} x &= \frac{1}{2}\left(1 + erf \left(\frac{\log F^{-1}(u) - \mu}{\sigma \sqrt{2}} \right) \right) \\ erf^{-1} \left(2x-1\right) &= \frac{\log F^{-1}(u) - \mu}{\sigma \sqrt{2}} \\ \sigma \sqrt{2} erf^{-1} \left(2x-1\right) +\mu &= \log F^{-1}(u) \\ \exp\left(\sigma \sqrt{2} erf^{-1} \left(2x-1\right) +\mu\right) &= F^{-1}(u) \\ \end{align}
which is what iX3 got.