I am looking at a software library where there is a function that multiplies two Gamma distributions defined over the same random variable. So, it is basically multiplying two Gamma densities with shape and rate parameters.

So, the Gamma distribution parameterised by the shape and rate parameters is given as:

$$ D(x; \alpha, \beta) = \frac{\beta^{\alpha} x^{\alpha-1} e^{-\beta x}}{\Gamma(\alpha)} $$

where $\alpha$ is the shape parameter and $\beta$ is the rate parameter and $\Gamma$ is the Gamma function defined as $\Gamma(\alpha) = \int_{0}^{\infty} x^{\alpha-1} e^{-x} dx$.

Do, I want to get an expression for the product of $D(x; \alpha_0, \beta_0)$ and $D(x; \alpha_1, \beta_1)$. Apparently, this should be another Gamma distribution and according to this software implementation, the shape and rate parameters for this new Gamma distribution should be: $\alpha_{new} = \alpha_0 + \alpha_1 - 1$ and $\beta_{new} = \beta_0 + \beta_1$.

Now, apparently this should be simple algebra but I have been unsuccessfully been trying to formulate this product in a way that I can equate the terms with the expression for the Gamma distribution that would arrive at this result.

  • 1
    $\begingroup$ math.stackexchange.com/questions/203621/… this may help you $\endgroup$ Feb 20, 2014 at 19:21
  • $\begingroup$ My case is slightly different as the random variable over which these distributions are defined are the same. So, $x$ is the RV and it is the same in both the expressions. Hence, it is less complicated but I still cannot see how the authors came to that expression. The author, in question, is very well known and accomplished, so it is likely I have not figured it out. $\endgroup$
    – Luca
    Feb 20, 2014 at 19:29
  • 1
    $\begingroup$ there exist another definition of gamma function,so you may use elementary algebraic property like $e^{x+y}=e^{x}*e^{y}$ and so on $\endgroup$ Feb 20, 2014 at 19:31
  • $\begingroup$ Thanks for the reply Dato. Do you have any reference for this definition? That would be very useful. I tried finding it but do not know which one you are talking about. $\endgroup$
    – Luca
    Feb 20, 2014 at 21:29
  • 1
    $\begingroup$ I suspect the real problem behind this question is that the density of the product of random variables is not the product of the densities, as implicitly suggested by the comments. $\endgroup$
    – whuber
    Jan 20, 2023 at 14:20

1 Answer 1


The product of two gamma densities on the same variable is proportional to another gamma density ... as long as the sum of the two shape parameters in the product is > 1. When that's not true, it's not the case that the product is proportional to a density.


$$g(x) = f(x;\alpha_1,\beta_1)\cdot f(x;\alpha_2,\beta_2)$$

where $f(x;\alpha,\beta) = \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1} e^{- \beta x }\,,\quad x>0,\,\alpha,\beta>0$

$$g(x) = \frac{\beta_1^{\alpha_1}}{\Gamma(\alpha_1)} x^{\alpha_1-1} e^{- \beta_1 x }\frac{\beta_2^{\alpha_2}}{\Gamma(\alpha_2)} x^{\alpha_2-1} e^{- \beta_2 x }$$

$$\quad\quad = \frac{\beta_1^{\alpha_1}}{\Gamma(\alpha_1)}\frac{\beta_2^{\alpha_2}}{\Gamma(\alpha_2)} x^{\alpha_1-1}x^{\alpha_2-1} e^{- \beta_1 x }e^{- \beta_2 x }$$

$$\quad\quad = \frac{\beta_1^{\alpha_1}}{\Gamma(\alpha_1)}\frac{\beta_2^{\alpha_2}}{\Gamma(\alpha_2)} x^{(\alpha_1+\alpha_2-1)-1} e^{- (\beta_1+ \beta_2) x }$$

Clearly, for that to be proportional to a $\text{gamma}(\alpha_1+\alpha_2-1,\beta_1+ \beta_2)$ density, its parameters must obey the constraints on the parameters (i.e. $\alpha_1+\alpha_2-1>0$, or $\alpha_1+\alpha_2>1$).

What happens when it's not the case that $\alpha_1+\alpha_2-1>0$?

To simplify things consider $\beta_1+ \beta_2=1$, and let $\delta=\alpha_1+\alpha_2-1$. The gamma pdf is:

$$\frac{1}{\Gamma(\delta)} x^{\delta-1} e^{- x }\,,\quad x>0\,.$$

Now in the case where $\delta\leq 0$, the integral that defines $\Gamma(\delta)$ doesn't converge (though the function is generally extended to negative values via analytic continuation, that's no longer the value of the integral).

Which is to say, we no longer have something proportional to a valid pdf.

When $\alpha_1+\alpha_2>1$, the multiplicative constant out the front of the gamma density is


which can be simplified a little, but which I won't pursue further here as I don't think that's what you're after.

  • $\begingroup$ Thanks for the answer! One thing that bothers me is the normalizer. Clearly it is not of the form $\a^{\b}$ where $a = \beta_1 + \beta_2$ and $b = \alpha_1 + \alpha_2 - 1$. Same goes for the multiplication of these $\Gamma$ functions. So, it is proportional to a Gamma distribution but the constant of proportionality does not match... $\endgroup$
    – Luca
    Feb 21, 2014 at 11:22
  • 1
    $\begingroup$ @Luca Right - the product of gamma densities isn't a density, but it's proportional to one (given the restrictions mentioned). Why would that bother you? It's generally not the case that the product of densities is a density, so I see no reason to expect it to hold here. Does it also bother you that the product of two normal densities isn't a normal density (it's proportional to one, as here)? $\endgroup$
    – Glen_b
    Nov 1, 2014 at 1:52
  • $\begingroup$ You are right Glen. I am still getting over my hangups about these things :-) many thanks again for all your help. $\endgroup$
    – Luca
    Nov 1, 2014 at 13:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .