Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Determining the distribution of a variable

  1. Feb 16, 2012 #1

    I am trying to understand how to predict the distribution of a variable that is a combination of other random variables. For example, how should I determine the distribution of Variable A, which is the sum of Variable X and Variable Y? Variable X has a normal distribution and Variable B has a uniform distribution.

    Also, what will be the distribution of Variable B, which is a product of X and Y?

  2. jcsd
  3. Feb 17, 2012 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    The very general idea is that if you want to know the probability that A = r and A is a function of X and Y, then you must add up the probabilities of all the combinations of values of X and Y that make the function equal to r.

    In the case of continuous random variables, the "adding up" is done by integration instead of taking a finite sum.

    In the special case where A is the sum of X and Y, the process of doing the summation or integration is called a "convolution".

    You can think of the convolution that computes Pr( A = X + Y = r) as doing the summation over all values x and y such at x + y = r. So if we take y as given then x = r - y.

    The summation is :

    The sum over all possible values of y of Pr( X = r-y and Y = y )

    If X and Y are independent then the joint density Pr(X = r-y and Y =y ) is Pr(X=r-y) Pr(Y=y).

    For continuous random variables, if X and Y are independent and X has density f(x) and Y has density g(y) the density h(r) of A = X + Y is

    [tex] h(r) = \int f(r-y) g(y) \ dy [/tex]

    Do you feel up to doing the calculus to solve your particular example? I think the answer will involve the cumulative of the normal distribution so it isn't a "closed form" solution.

    For the case of the product of two random variables A = (X)(Y) you need to do a calculation that sums (or integrates) over all possible values of x,y where xy = r. So x = r/y.
  4. Feb 18, 2012 #3


    User Avatar
    Gold Member

    If you're only interested in the moments of A = X + Y, then the moment generating function becomes very useful because the MGF of A will be the product of the MGFs of X and Y (provided their independent).

    If you have access to a good table of integral transforms, or Mathematica/Maple this is also an easy way to get the pdf for your variable. For example to do the example you asked about with the uniform distribution going over the interval from 0 to 1 and the normal variable having mean 0 and variance 1 you'd just do

    Code (Text):

        UnitStep[x] - UnitStep[x - 1], x, t] FourierTransform[Exp[-x^2],
        x, t]), t, x]
    And Mathematica spits out

    [tex]\frac{\text{Erf}[1-x]+\text{Erf}[x]}{2 \sqrt{2}} [/tex]

    Note above I use the characteristic function, not mgfs of the pdf but it's the same idea.
    Last edited: Feb 18, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook