Solved – Skewness of the logarithm of a gamma random variable

gamma distributionlogarithmskewness

Consider gamma random variable $X\sim\Gamma(\alpha, \theta)$. There are neat formulas for the mean, variance, and skewness:

\begin{align}
\mathbb E[X]&=\alpha\theta\\
\operatorname{Var}[X]&=\alpha\theta^2=1/\alpha\cdot\mathbb E[X]^2\\
\operatorname{Skewness}[X]&=2/\sqrt{\alpha}
\end{align}

Consider now a log-transformed random variable $Y=\log(X)$. Wikipedia gives formulas for the mean and the variance:

\begin{align}
\mathbb E[Y]&=\psi(\alpha)+\log(\theta)\\
\operatorname{Var}[Y]&=\psi_1(\alpha)\\
\end{align}

via digamma and trigamma functions which are defined as the first and the second derivatives of the logarithm of the gamma function.

What is the formula for the skewness?

Will tetragamma function appear?

(What made me wonder about this is a choice between lognormal and gamma distributions, see Gamma vs. lognormal distributions. Among other things, they differ in their skewness properties. In particular, skewness of the log of lognormal is trivially equal to zero. Whereas skewness of the log of gamma is negative. But how negative?..)

Best Answer

The moment generating function $M(t)$ of $Y=\ln X$ is helpful in this case, since it has a simple algebraic form. By the definition of m.g.f., we have $$\begin{aligned}M(t)&=\operatorname{E}[e^{t\ln X}]=\operatorname{E}[X^t]\\ &=\frac{1}{\Gamma(\alpha)\theta^\alpha}\int_0^\infty x^{\alpha+t-1}e^{-x/\theta}\,dx\\ &=\frac{\theta^{t}}{\Gamma(\alpha)}\int_0^\infty y^{\alpha+t-1}e^{-y}\,dy\\ &=\frac{\theta^t\Gamma(\alpha+t)}{\Gamma(\alpha)}.\end{aligned}$$

Let's verify the expectation and the variance you gave. Taking derivatives, we have $$M'(t)=\frac{\Gamma'(\alpha+t)}{\Gamma(\alpha)}\theta^t+\frac{\Gamma(\alpha+t)}{\Gamma(\alpha)}\theta^t\ln(\theta)$$ and $$M''(t)=\frac{\Gamma''(\alpha+t)}{\Gamma(\alpha)}\theta^t+\frac{2\Gamma'(\alpha+t)}{\Gamma(\alpha)}\theta^t\ln(\theta)+\frac{\Gamma(\alpha+t)}{\Gamma(\alpha)}\theta^t\ln^2(\theta).$$ Hence, $$\operatorname{E}[Y]=\psi^{(0)}(\alpha)+\ln(\theta),\qquad\operatorname{E}[Y^2]=\frac{\Gamma''(\alpha)}{\Gamma(\alpha)}+2\psi^{(0)}(\alpha)\ln(\theta)+\ln^2(\theta).$$ It follows then $$\operatorname{Var}(Y)=\operatorname{E}[Y^2]-\operatorname{E}[Y]^2=\frac{\Gamma''(\alpha)}{\Gamma(\alpha)}-\left(\frac{\Gamma'(\alpha)}{\Gamma(\alpha)}\right)^2=\psi^{(1)}(\alpha).$$

To find the skewness, note the cumulant generating function (thanks @probabilityislogic for the tip) is $$K(t)=\ln M(t)=t\ln\theta+\ln\Gamma(\alpha+t)-\ln\Gamma(\alpha).$$ The first cumulant is thus simply $K'(0)=\psi^{(0)}(\alpha)+\ln(\theta)$. Recall that $\psi^{(n)}(x)=d^{n+1}\ln\Gamma(x)/dx^{n+1}$, so the subsequent cumulants are $K^{(n)}(0)=\psi^{(n-1)}(\alpha)$, $n\geq2$. The skewness is therefore $$\frac{\operatorname{E}[(Y-\operatorname{E}[Y])^3]}{\operatorname{Var}(Y)^{3/2}}=\frac{\psi^{(2)}(\alpha)}{[\psi^{(1)}(\alpha)]^{3/2}}.$$

As a side note, this particular distribution appeared to have been thoroughly studied by A. C. Olshen in his Transformations of the Pearson Type III Distribution, Johnson et al.'s Continuous Univariate Distributions also has a small piece about it. Check those out.