4

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?

kaba
  • 233
  • 1
  • 7

1 Answers1

4

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.

kaba
  • 233
  • 1
  • 7