Sums of two probability density functions [closed]

I think you mean how to find the probability density of the random variable that is the sum of two other random variables, using the probability densities of these two variables. The answer is that the probability density of the sum is the convolution of the densities of the two other random variables if they are independent.

Let's say $Z = X + Y$, then the density of the sum is given by $$ f_Z \left( z \right) = \int_{-\infty}^{\infty} f_X \left( z - y \right) f_Y \left( y \right) d y $$

assuming all variables are real valued, that $X,Y$ are independent and that $f_X,f_Y,f_Z$ are the densities of $X,Y,Z$ respectivley.


I think you might mean, "What happens if I'm not sure which of two distributions a random variable will be drawn from?" That is one situation where you need to take a pointwise weighted sum of two PDFs, where the weights have to add to 1.

Suppose you have three coins in your pocket, two fair coins and one which lands as 'Heads' two thirds of the time. You draw one at random from your pocket and flip it. Then the PMF is \begin{align*}f(x)&=2/3\times\left.\cases{1/2, x=\text{'Heads'}\\1/2,x=\text{'Tails'}}\right\}+1/3\times\left.\cases{2/3, x=\text{'Heads'}\\1/3, x=\text{'Tails'}}\right\}\\&=\cases{5/9, x=\text{'Heads'},\\4/9,x=\text{'Tails'}.}\end{align*}

The formula is simple: for any value for x, add the values of the PMFs at that value for x, weighted appropriately. If the sum of the weights is 1, then the sum of the values of the weighted sum of your PMFs will be 1, so the weighted sum of your PMFs will be a probability distribution.

The same principle applies when adding continuous PDFs.

Suppose you have a large group of geese where the female geese have body weights following an N(3,1) distribution and the male geese have weights following an N(4,1) distribution. You toss your unfair coin, and if, with probability 2/3, it is heads, you choose a random female goose, and otherwise choose a random male goose, then the weight of the goose has PDF

$f(x)=\frac{1}{3}\times \frac{1}{\sqrt{2 \pi{}\times9}}e^{-\frac{1}{2}(x-1)^2/9}+\frac{2}{3}\times \frac{1}{\sqrt{2 \pi{}\times16}}e^{-\frac{1}{2}(x-1)^2/16}.$

You can even integrate over infinitely many PDFs, in which case your weight function is another PDF. For example, suppose you have a robot with an Exp(1) life span programmed to move left or right at a fixed speed with equal probability in each arbitrarily short time interval, independent of its movement in every other time interval (this is called Brownian motion). Its position after time $t$ follows a N(0,t) distribution, so its position at the end of its life span is

\begin{align*}f(x)=\int_0^\infty e^{-\sigma^2} \frac{1}{\sqrt{2\pi\sigma^2}}e^{\frac{1}{2}x^2/\sigma^2} \text{d}\sigma^2.\end{align*}

This is a very open field. Play with it yourself for a while and see where it takes you.


References

Taleb, Nicholas Nassim (2007) The Black Swan

Same author (2013), Collected Scientific Papers, https://docs.google.com/file/d/0B_31K_MP92hUNjljYjIyMzgtZTBmNS00MGMwLWIxNmQtYjMyNDFiYjY0MTJl/edit?hl=en_GB