# Sums of two probability density functions [closed]

How to find the sum of two probability density functions?What is the formula used for this purpose?

-

## closed as off-topic by Did, vonbrand, TooTone, froggie, LutzLFeb 24 '14 at 17:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Did, vonbrand, TooTone, froggie
If this question can be reworded to fit the rules in the help center, please edit the question.

It would get you better results if you provide the context of the problem and what you've done so far. Also, it is not entirely clear to me what you mean by the sum of density functions. Do you expect that to be a density function? – Ittay Weiss Dec 23 '12 at 7:32

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

-
Why the ad? How is it related to the arch-classical notion of mixture model? – Did Feb 24 '14 at 16:18
What is the arch-classical notion of mixture model? The reference is where I saw the idea of integrating over PDFs. – Gred Feb 24 '14 at 16:23
You were right to delete the first version of your comment. About mixture models, why not try the obvious? There is already more than you want to know there... – Did Feb 24 '14 at 16:32

As learner points out, its the convolution you are after. Better context on what the individual probability density functions are would help.

-