# Mean and Variance of a Random Variable with a Given PDF

Suppose that I have a random variable $X$ with the following PDF:

$$f_X(x)=\frac{(ln(x))^{\alpha-1}}{\Gamma(\alpha)\beta^\alpha x^{1+\frac{1}{\beta}}}$$ for $1<x<\infty$, $\alpha>0$, and $\beta>0$.

Suppose I want to calculate the mean and variance of this distribution. But I don't know how to compute the integral:

$$\int_{1}^{\infty}\frac{(ln(x))^{\alpha-1}}{\Gamma(\alpha)\beta^\alpha x^{\frac{1}{\beta}}}dx$$ for the first moment. Similarly, I don't know how to compute the integral for the second moment needed for the variance either. Can this definite integral be evaluated in terms of $\alpha$ and $\beta$? If so, how? If not, how else would you calculate the mean and variance?

• I can tell you that the answer to that integral is $1$ since it is a probability density function. Feb 12, 2018 at 21:20
• No, the integral is the value of the first moment. Look more closely. Feb 12, 2018 at 21:20
• I see now. Thank you. Feb 12, 2018 at 21:21

hint simply change variables to $u=\ln(x)$ and what you get should be related to the integral representation for the Gamma function.

• Gamma of alpha is a constant; that's not my concern here. But I'll try the substitution and see if I can get anywhere. Feb 12, 2018 at 21:21
• Well if you were to take the zeroth moment to check that the distribution were properly normalized, how would you do so? The special function defining the normalization constant is usually important when calculating moments. Feb 12, 2018 at 21:25
• In this particular situation, leaving the final answer for the moments in terms of the gamma function is preferable. I'm supposed to get a general formula out of this left in terms of alpha and beta. Feb 12, 2018 at 21:27
• And you can. The $k$-th moment is $(1-k\beta)^{-\alpha}.$ (provided $k\beta <1$... otherwise does not exist.) Feb 12, 2018 at 21:38

We can compute the $k$-th moment this way:$$\int_{1}^{\infty}x^k\frac{(ln(x))^{\alpha-1}}{\Gamma(\alpha)\beta^\alpha x^{\frac{1}{\beta}+1}}dx = \frac{1}{\Gamma(\alpha)\beta^{\alpha}}\int_{0}^{\infty} \frac{e^{uk}u^{\alpha-1}}{e^{\frac {u}{\beta}}}du = \frac{1}{\Gamma(\alpha)\beta^{\alpha}(\frac{1}{\beta}-k)^{\alpha}}\int_{0}^{\infty} t^{\alpha-1}e^{-t}dt = \frac{\Gamma(\alpha)}{\Gamma(\alpha)\beta^{\alpha}(\frac{1}{\beta}-k)^{\alpha}} = (1-k\beta)^{-\alpha}.$$ Where we used these two transformations: $u=ln(x)$ and $t= u(\frac 1 {\beta}-k)$.

• Actually, the kth moment is given by $$\int_{1}^{\infty}x^k\frac{(ln(x))^{\alpha-1}}{\Gamma(\alpha)\beta^\alpha x^{\frac{1}{\beta}+1}}dx$$ So I think that you've computed the k+1 moment, right? Feb 12, 2018 at 22:33
• Yes thank you!! Feb 12, 2018 at 22:47
• Actually, your original formula lines up with what I'm calculating using a computer to crunch the numbers and compare. Apparently you really did calculate the kth moment originally. But that doesn't seem to line up with the math. I must have missed something. I'll have to check back later. Feb 12, 2018 at 23:09
• Is this correct now? Feb 12, 2018 at 23:10
• It's the fact that there's a $1/x$ in the change of variables $du= dx/x.$ Feb 12, 2018 at 23:24

Even if do not know the substitution as mentioned by the answer, you can make use of the fact that the integral of the density is equal to $1$ if it is a valid pdf, i.e. $\alpha, \beta > 0$ . Therefore,

\begin{align} E[X^k] &= \int_1^{\infty} x^k \frac {\ln(x)^{\alpha-1}} {\Gamma(\alpha)\beta^{\alpha}x^{\frac {1} {\beta}+1}}dx \\ &= \int_1^{\infty} \frac {\ln(x)^{\alpha-1}} {\Gamma(\alpha)\beta^{\alpha}x^{\frac {1} {\beta}-k+1}}dx \\ &= \frac {\left(\frac {\beta} {1-k\beta}\right)^{\alpha} } {\beta^{\alpha}}\int_1^{\infty} \frac {\ln(x)^{\alpha-1}} {\Gamma(\alpha)\left(\frac {\beta} {1-k\beta}\right)^{\alpha}x^{\left(\frac {\beta} {1-k\beta}\right)^{-1} +1}}dx \\ \end{align} Note that the integrand is a valid pdf with new parmeters $\displaystyle \alpha' = \alpha, \beta' = \frac {\beta} {1 - k\beta}$ if $\alpha',\beta' > 0$ And this is equivalent to $\displaystyle k < \frac {1} {\beta}$. In such case, the integral is equal to $1$, and the remaining constants can be simplified to the answer $(1 - k\beta)^{-\alpha}$