7

Let $w(x) = x \log{x}$

$x \sim Gamma(\alpha = 3.7, \lambda = 1)$

Find $E[w(x)]$

I have set up the following integral:

$\int_0^{\infty} x\log{x} \frac{\lambda^{\alpha}}{\Gamma(\alpha)} x^{\alpha -1} e^{-(\lambda)x}dx$

Brute-forcing it doesn't seem to be working, but I can't find the "trick".

I know from simulation that it should be approximately 5.32, I just need to compare it to the analytical solution.

gunes
  • 49,700
  • 3
  • 39
  • 75
jbpib27
  • 73
  • 5

1 Answers1

10

$$\begin{align}E[X\log X]&=\int_0^\infty \log x \frac{\lambda^\alpha}{\Gamma(\alpha)}x^\alpha e^{-\lambda x}dx\\&=\frac{\Gamma(\alpha+1)}{\Gamma(\alpha)\lambda}\int_0^\infty\log x\frac{\lambda^{\alpha+1}}{\Gamma(\alpha+1)}x^{(\alpha+1)-1}e^{-\lambda x}dx\\&=\frac{\Gamma(\alpha+1)}{\Gamma(\alpha)\lambda}E[\log Y]\end{align}$$ where $Y\sim \text{Gamma}(\alpha_y=\alpha+1, \lambda_y=\lambda)$. From here, the expected value of the logarithm of a gamma RV is: $$E[\log Y]=-\log\lambda+\psi(\alpha+1)$$ where $\psi$ stands for polygamma function.

So, the overall result is (put $\alpha=3.7, \lambda=1$): $$E[X\log X]=\underbrace{\frac{\Gamma(4.7)}{1\times\Gamma(3.7)}}_{3.7}(-\log 1 +\psi(4.7))\approx5.32$$

I've used Matlab's psi function to calculate the polygamma function.

gunes
  • 49,700
  • 3
  • 39
  • 75