Distribution Difference of Two Independent Random Variables

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
8 replies · 15K views
izelkay
Messages
115
Reaction score
3

Homework Statement


Z = X - Y and I'm trying to find the PDF of Z.

Homework Equations


Convolution

The Attempt at a Solution



Started by finding the CDF:
Fz(z) = P(Z ≤ z)

P(X - Y ≤ z)

So I drew a picture

jXF8OPD.png

So then should Fz(z) be:
L3ergX2.png

since, from my graph, it looks as though Y can go from negative infinity to positive infinity, and X can go from negative infinity on the left but is bounded by z+y on the right

then should the pdf be:
Edit: sorry I forgot to include the fact that, because fx and fy are independent, f(x,y) = fxfy in the following derivation
lTE7FtX.png

?
 
Last edited:
Physics news on Phys.org
izelkay said:

Homework Statement


Z = X - Y and I'm trying to find the PDF of Z.

Homework Equations


Convolution

The Attempt at a Solution



Started by finding the CDF:
Fz(z) = P(Z ≤ z)

P(X - Y ≤ z)

So I drew a picture

jXF8OPD.png

So then should Fz(z) be:
L3ergX2.png

since, from my graph, it looks as though Y can go from negative infinity to positive infinity, and X can go from negative infinity on the left but is bounded by z+y on the right

then should the pdf be:
Edit: sorry I forgot to include the fact that, because fx and fy are independent, f(x,y) = fxfy in the following derivation
lTE7FtX.png

?

What is your question?
 
Oh yes, sorry I was wondering if what I arrived at for the PDF of the difference of two independent random variables was correct.
proxy.php?image=http%3A%2F%2Fi.imgur.com%2FlTE7FtX.png

I tried Googling but all I could find was the pdf of the sum of two RVs, which I know how to do already.
 
Yes, it looks ok. You should note that if you know the pdf of the sum and the pdf of the negative of a distribution (i.e., if you know how the the distribution of ##Y##, what is the distribution of ##-Y##), then you can use these two to obtain the distribution of ##X-Y##.
 
  • Like
Likes   Reactions: izelkay
Orodruin said:
Yes, it looks ok. You should note that if you know the pdf of the sum and the pdf of the negative of a distribution (i.e., if you know how the the distribution of ##Y##, what is the distribution of ##-Y##), then you can use these two to obtain the distribution of ##X-Y##.
I'm going to modify the problem a little bit, can you tell me if I do it right/wrong?

X and Y are two independent random variables, each of which are uniform on (0,1). Find the pdf of Z = X - Y

Using my result from above, the pdf of Z is given by:
s%3A%2F%2Fwww.physicsforums.com%2Fproxy.php%3Fimage%3Dhttp%253A%252F%252Fi.imgur.com%252FlTE7FtX.png

X ~ U(0,1) and Y ~ U(0,1)

The pdf of fx(x) and fY(y) are both 1 on (0,1) and 0 otherwise.

z goes from -1 to 1 because of X - Y right?

For -1 ≤ z ≤ 0
fy is uniform only on (0,1) so my integral limits should be z+1 to z

For 0 ≤ z ≤ 1 I wouldn't need to change the limits here, just from 0 to 1

So then the pdf of X - Y is:

R2EM2LA.png

Is this correct?
 
izelkay said:
I'm going to modify the problem a little bit, can you tell me if I do it right/wrong?

X and Y are two independent random variables, each of which are uniform on (0,1). Find the pdf of Z = X - Y

Using my result from above, the pdf of Z is given by:
s%3A%2F%2Fwww.physicsforums.com%2Fproxy.php%3Fimage%3Dhttp%253A%252F%252Fi.imgur.com%252FlTE7FtX.png

X ~ U(0,1) and Y ~ U(0,1)

The pdf of fx(x) and fY(y) are both 1 on (0,1) and 0 otherwise.

z goes from -1 to 1 because of X - Y right?

For -1 ≤ z ≤ 0
fy is uniform only on (0,1) so my integral limits should be z+1 to z

For 0 ≤ z ≤ 1 I wouldn't need to change the limits here, just from 0 to 1

So then the pdf of X - Y is:

R2EM2LA.png

Is this correct?

No, it cannot possibly be correct, because you would have f(z) = -1 for -1 < z < 0 and f(z) = 1 for 0 < z < 1. That kind of f cannot be a probability density function.

You need to go back and evaluate the limits more carefully; in cases like this, drawing an x,y diagram of the integration region would be helpful.
 
  • Like
Likes   Reactions: izelkay
Ray Vickson said:
No, it cannot possibly be correct, because you would have f(z) = -1 for -1 < z < 0 and f(z) = 1 for 0 < z < 1. That kind of f cannot be a probability density function.

You need to go back and evaluate the limits more carefully; in cases like this, drawing an x,y diagram of the integration region would be helpful.
I don't have much practice drawing integration regions of density functions and I wouldn't know where to start with this one besides drawing the box with vertices (0,0), (0,1), (1,0), (1,1).

I think I found another way to look at it though:

If -1 ≤ z ≤ 0,

If I want fx(z+y) to be 1, I need to shift the bounds by +1, and then I'll need z+y+1 ≥ 0 , or y ≥ -1-z

So
JuURESd.png


Then on 0 ≤ z ≤ 1,

I need z+y ≤ 1, or y ≤ 1 - z

So
do0sH.png


Then all together this is:

1 + z , -1 ≤ z ≤ 0
1 - z , 0 ≤ z ≤ 1

I got the same answer as here: http://www.math.wm.edu/~leemis/chart/UDR/PDFs/StandarduniformStandardtriangular.pdf
but I'm not sure my process is correct because my bounds are a little different than theirs, and I don't know how they computed the cdf
 
izelkay said:
I don't have much practice drawing integration regions of density functions and I wouldn't know where to start with this one besides drawing the box with vertices (0,0), (0,1), (1,0), (1,1).

I think I found another way to look at it though:

If -1 ≤ z ≤ 0,

If I want fx(z+y) to be 1, I need to shift the bounds by +1, and then I'll need z+y+1 ≥ 0 , or y ≥ -1-z

So
JuURESd.png


Then on 0 ≤ z ≤ 1,

I need z+y ≤ 1, or y ≤ 1 - z

So
do0sH.png


Then all together this is:

1 + z , -1 ≤ z ≤ 0
1 - z , 0 ≤ z ≤ 1

I got the same answer as here: http://www.math.wm.edu/~leemis/chart/UDR/PDFs/StandarduniformStandardtriangular.pdf
but I'm not sure my process is correct because my bounds are a little different than theirs, and I don't know how they computed the cdf

You already drew part of the diagram in Post #1. You just need to add the boundary lines x = 0, x = 1, y = 0, y = 1 and you are done---that's your drawing!

You say you "don't know how they computed the cdf". Well, you claimed before that you know how to compute the cdf of a SUM, and that is all you need to do.

If ##Z = X-Y## then ##S = Z+1## has the form ##S = X + (1-Y) = X + Y'##, where ##X## and ##Y' = 1-Y## are independent and ##\rm{U}(0,1)## random variables. Thus, ##S## is the sum of two uniforms, and has a well-known, widely-documented triangular density:
[tex]f_S(s) = \begin{cases} s, & 0 < s < 1\\ 2-s, & 1 < s < 2\\<br /> 0 & \rm{elsewhere}<br /> \end{cases}[/tex]
Now just shift the graph of ##f_S(s)## one unit to the left, and that would be your density of ##Z##: ##f_Z(z) = f_S(1+z), \; -1 < z < 1##.
 
Last edited:
  • Like
Likes   Reactions: izelkay