I'm trying to compute the probability density of a random variable $\log(X)$, where $X \sim \textrm{Gamma}(k, \Theta)$, in Mathematica 11. One way to do this is by:

F[x_] = PDF[TransformedDistribution[Log[X], X \[Distributed] GammaDistribution[k, \[CapitalTheta]]], x]

The answer corresponds to what I can prove by hand:

$$\frac{\Theta ^{-k} e^{k x-\frac{e^x}{\Theta }}}{\Gamma (k)}$$

According to the documentation, "The exp-gamma distribution is mathematically defined to be the distribution that models Y==log(X) whenever X ~ GammaDistribution". Therefore, it seems I should get the same result with

G[x_] = PDF[ExpGammaDistribution[k, \[CapitalTheta], 0], x]

However, the answer is different:

$$\frac{e^{\frac{k x}{\Theta }-e^{x/\Theta }}}{\Theta \Gamma (k)}$$

This is a different function, which can be seen by plotting:

Plot[{F[x], G[x]} /. {k -> 3, \[CapitalTheta] -> 2}, {x, 0, 5}]

What am I missing?

  • 4
    $\begingroup$ The relation is shown in Properties & Relations in the documentation for ExpGammaDistribution $\endgroup$ Feb 15 '17 at 13:49
  • $\begingroup$ @Kaba would you consider expanding your comment into a self-answer? I think it could be beneficial for future reference. $\endgroup$
    – MarcoB
    Feb 16 '17 at 4:43
  • $\begingroup$ @MarcoB I added an answer. $\endgroup$
    – kaba
    Feb 16 '17 at 10:11

Later in the documentation examples, it is seen that $\mathrm{ExpGamma}[k,\Theta]$ is the distribution of $\Theta \log(X)$, where $X \sim \mathrm{Gamma}[k, 1]$. The $\Theta$ in the $\mathrm{ExpGamma}$ distribution is not related to the $\Theta$ in the $\mathrm{Gamma}$ distribution.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.