Distribution of a Function of a Random Variable

izelkay
Messages
115
Reaction score
3

Homework Statement


If X is uniformly distributed over (0,1), find the PDF of Y = |X| and Z = e^X

Focusing on the |X| one

Homework Equations


Derivative of CDF is the PDF

The Attempt at a Solution


So I start by writing down the CDF of X, Fx(x):

0 for x <0
x for 0 ≤ x ≤ 1
1 for x ≥ 1

And I also know the range of Y = |X| is [0,1]
Finding the CDF of Y:

FY(y) = P(Y≤y)
=
P(|X|≤y)
=
P(-y ≤ X ≤ y)
=
Fx(y) - Fx(-y)

So
FY(y) = Fx(y) - Fx(-y)

But the range of Y is [0,1] so I can get rid of the Fx(-y) and have

FY(y) = Fx(y) = y

So the CDF of Y is then

0 for y < 0
y for 0 ≤ y ≤ 1
1 for y≥1

To find the PDF, I can just take the derivative and have

1 for 0 ≤ y ≤ 1
0 otherwise

Is this correct?
 
Physics news on Phys.org
izelkay said:

Homework Statement


If X is uniformly distributed over (0,1), find the PDF of Y = |X| and Z = e^X

Focusing on the |X| one

Homework Equations


Derivative of CDF is the PDF

The Attempt at a Solution


So I start by writing down the CDF of X, Fx(x):

0 for x <0
x for 0 ≤ x ≤ 1
1 for x ≥ 1

And I also know the range of Y = |X| is [0,1]
Finding the CDF of Y:

FY(y) = P(Y≤y)
=
P(|X|≤y)
=
P(-y ≤ X ≤ y)
=
Fx(y) - Fx(-y)

So
FY(y) = Fx(y) - Fx(-y)

But the range of Y is [0,1] so I can get rid of the Fx(-y) and have

FY(y) = Fx(y) = y

So the CDF of Y is then

0 for y < 0
y for 0 ≤ y ≤ 1
1 for y≥1

To find the PDF, I can just take the derivative and have

1 for 0 ≤ y ≤ 1
0 otherwise

Is this correct?

You can simplify the argument by noting that, for X ~ Unif(0,1), we have |X| = X for all nonzero values of X; this just eliminates any need to look at the zero-probability values X < 0 or X > 1. (However, to a certain extent, the way you should do it depends on how your textbook or course notes do it.)
 
Is the way I approached it correct though?
Like for example, if I changed the problem statement so that X is uniformly distributed over (-5,5) and I want to find the PDF of Y= |X|, then the range of Y would be [0,5].

The CDF of X is

0 for x < 0
x for -5 ≤ x ≤ 5
1 for x > 5

Repeating the process I did before, the CDF of Y would be

0 for y < 0
y for 0 ≤ y ≤ 5
1 for y > 5

Then the PDF would be
1 for 0 < y < 5
0 otherwise
 
izelkay said:
Is the way I approached it correct though?
Like for example, if I changed the problem statement so that X is uniformly distributed over (-5,5) and I want to find the PDF of Y= |X|, then the range of Y would be [0,5].

The CDF of X is

0 for x < 0
x for -5 ≤ x ≤ 5
1 for x > 5

Repeating the process I did before, the CDF of Y would be

0 for y < 0
y for 0 ≤ y ≤ 5
1 for y > 5

Then the PDF would be
1 for 0 < y < 5
0 otherwise

That is obviously wrong because the area under its graph is 5, not 1. You have the wrong distribution at the beginning for a uniform distribution on (-5,5).
 
LCKurtz said:
That is obviously wrong because the area under its graph is 5, not 1. You have the wrong distribution at the beginning for a uniform distribution on (-5,5).
Oh oops, I meant to write:

The CDF of X is

0 for x < -5
x for -5 ≤ x ≤ 5
1 for x > 5

Is that correct?

And then I'm not quite sure I understand what you mean by "the area under its graph is 5, not 1".
How would I find the PDF of Y?

If I find the CDF first:
FY(y) = P(Y≤y)
=
P(|X|≤y)
=
P(-y ≤ X ≤ y)
=
Fx(y) - Fx(-y)

So
FY(y) = Fx(y) - Fx(-y)

But the range of Y is [0,5], so

FY(y) = Fx(y)

Then the pdf is (taking the derivative)

fY(y) = fx(y)

Which isn't 1 I guess; I'm stuck here.
 
izelkay said:
Oh oops, I meant to write:

The CDF of X is

0 for x < -5
x for -5 ≤ x ≤ 5
1 for x > 5

Is that correct?

Check it for yourself. Do you have F(-5) = 0? Do you have F(5) = 1?

And then I'm not quite sure I understand what you mean by "the area under its graph is 5, not 1".

Do you know what is meant by the area under a graph? Do you know how to compute it?How would I find the PDF of Y?

If I find the CDF first:
FY(y) = P(Y≤y)
=
P(|X|≤y)
=
P(-y ≤ X ≤ y)
=
Fx(y) - Fx(-y)

So
FY(y) = Fx(y) - Fx(-y)

But the range of Y is [0,5], so

FY(y) = Fx(y)

Then the pdf is (taking the derivative)

fY(y) = fx(y)

Which isn't 1 I guess; I'm stuck here.
 
Ok so I drew a picture of X:
j1dZEcY.png

Looking at this chart:
XRRRXWC.png

The pdf of X for mine must be 1/10 for -5 ≤ x ≤ 5 and 0 otherwise right?
And the CDF of X is
0 for x < -5
(x+5)/10 for -5 ≤ x < 5
1 for x ≥5
 
"Do you know what is meant by the area under a graph? Do you know how to compute it?"

If the range of Y is [0,5]

Then the area under the PDF from [0,5] needs to be 1 correct? If I drew a picture similar to the one I drew for X, that would mean the height of the rectangle is 1/5. So is the PDF of Y

1/5 for 0 ≤ y ≤ 5
0 otherwise
?
 
Back
Top