# The expected value of log Gamma function

Suppose $$X$$ is exponentially distributed with the rate parameter $$\lambda$$. If we have the expected value of $$\log X$$ as $$$$\langle \log X\rangle=-\gamma-\log\lambda$$$$ where $$\gamma$$ is the Euler–Mascheroni constant.

Now I am wondering how I can compute the expected value of $$\log \Gamma(X)$$? I don't know whether it makes it simpler if we integrate by part like the following $$$$\langle \log \Gamma(X)\rangle=-\exp(-\lambda X)\log\Gamma(X)+\int \psi(X)\exp(-\lambda X)\mathrm{d}X$$$$ where $$\psi(X)= \frac{\mathrm{d}}{\mathrm{d}X}\log \Gamma(X)$$. An approximation for $$\log \Gamma(x)$$ can be given as $$\log \Gamma(x)\approx(x-1/2)\log x-x+1/2\log(2\pi)+\frac{1}{12x}$$ I am also wondering whether there is a closed form answer for the above integral or not? Then maybe using this approximation of $$\Gamma$$ function can provide the best answer. Any suggestion would be appreciate?

• I wouldn't expect Stirling's asymptotic series to be a good approximation because it's poor for small values of $X.$ That will make it especially bad for large $\lambda,$ which concentrate most of the probability around small $X.$ You could, however, break the original integral into several pieces using the relation $\Gamma(z) = \Gamma(z+k)/(z(z+1)\cdots(z+k-1))$ for positive integers $k$ and approximating $\Gamma(z+k)$ with Stirling's expansion. This could be extremely accurate. – whuber May 4 at 16:15
• I took a closer look at that suggestion, hoping that perhaps a partial fractions expansion of $1/(z\cdots(z+k-1))$ might produce integrals one could evaluate. No such luck. Note that you can view this question as asking for the Laplace transform of $\log\Gamma$ (as defined on the positive reals), but no such transform is known. I think you will need to settle for approximations. Their form might vary depending on the magnitude of $\lambda.$ – whuber May 5 at 14:37
• @whuber I need to compute this term because I have a mixture of Gamma distribution model and I am using variational method for the inference and I must find a good approximation of this $\langle\alpha\rangle\big(\langle\log\alpha\rangle-\langle\log\beta\rangle\big)-\langle\log\Gamma(\alpha)\rangle-(\langle\alpha\rangle-1)\langle\log X\rangle-\langle\frac{\alpha}{\beta}\rangle\langle X\rangle$ where $\alpha$ based on similar model that I worked with, would vary between 0.1 to 2 or something. Do you think the approximation that I suggested would be sufficient for this range? – Dalek May 5 at 15:38
• The Stirling series is a poor approximation in that range. Why not use numerical integration? – whuber May 5 at 18:14
• @whuber this is part of a model that was developed earlier by someone else and I am modifying the model based on my problem. The whole variational model is coded in matlab and no numerical integration was used earlier. If I can approximate this expectation with 10^-4 accuracy, I think it would be sufficient – Dalek May 5 at 19:35