Transformation of random variable (uniform)

In summary: You obtain the p.d.f. of $Y=X^{2}$... it is important to say that You arrive to the same result if X is uniformley distributed in [0,1] or X is uniformly distributed in [-1,1]...Kind regards
  • #1
Jameson
Gold Member
MHB
4,541
13
This is something that when I see the work done it makes sense, but I find it difficult to do myself. I'm also aware there is an explicit formula for doing this but that involves Jacobians and a well-defined inverse, so I think it's more intuitive to do it step-by-step.

Problem: Suppose $X \text{ ~ } U(0,1)$. Find the density function of $Y=X^2$.

My attempt: I believe we should start by transforming the CDF and then differentiate to find the density function.

$P[Y \le y]=P[X^2 \le y]=P[X \le \sqrt{y}]$

Is this the direction I should be heading? From here should I try differentiating?

EDIT: I found some material on this question. It's important to note that $Y$ cannot be less than 0 so it seems that:
$$P[X \le \sqrt{y}]=P[-\sqrt{y} \le X \le \sqrt{y}]$$

Correct? Do the square roots look strange to anyone else? On my computer they look horrible.
 
Last edited:
Physics news on Phys.org
  • #2
Re: Transformation of random variable

Jameson said:
This is something that when I see the work done it makes sense, but I find it difficult to do myself. I'm also aware there is an explicit formula for doing this but that involves Jacobians and a well-defined inverse, so I think it's more intuitive to do it step-by-step.

Problem: Suppose $X \text{ ~ } U(0,1)$. Find the density function of $Y=X^2$.

My attempt: I believe we should start by transforming the CDF and then differentiate to find the density function.

$P[Y \le y]=P[X^2 \le y]=P[X \le \sqrt{y}]$

Is this the direction I should be heading? From here should I try differentiating?

EDIT: I found some material on this question. It's important to note that $Y$ cannot be less than 0 so it seems that:
$$P[X \le \sqrt{y}]=P[-\sqrt{y} \le X \le \sqrt{y}]$$

Correct? Do the square roots look strange to anyone else? On my computer they look horrible.

Hi Jameson!

There is no probability for X being negative, so there's no need to include the negative part.
It is important to note that Y cannot be negative, because otherwise its square root would not be defined for part of the X domain.

And yes, that is the right direction.
Write $P[X \le \sqrt{y}]$ as an integral first, then differentiate.Btw, the square root looks passable (but slightly inconsistent) on my monitor. ;)
However, the square brackets look pretty bad, especially the right one.
 
  • #3
Re: Transformation of random variable

Jameson said:
This is something that when I see the work done it makes sense, but I find it difficult to do myself. I'm also aware there is an explicit formula for doing this but that involves Jacobians and a well-defined inverse, so I think it's more intuitive to do it step-by-step.

Problem: Suppose $X \text{ ~ } U(0,1)$. Find the density function of $Y=X^2$.

My attempt: I believe we should start by transforming the CDF and then differentiate to find the density function.

$P[Y \le y]=P[X^2 \le y]=P[X \le \sqrt{y}]$

Is this the direction I should be heading? From here should I try differentiating?

EDIT: I found some material on this question. It's important to note that $Y$ cannot be less than 0 so it seems that:
$$P[X \le \sqrt{y}]=P[-\sqrt{y} \le X \le \sqrt{y}]$$

Correct? Do the square roots look strange to anyone else? On my computer they look horrible.

Excellent!... differentiating the probability You obtain the p.d.f. of $Y=X^{2}$... it is important to say that You arrive to the same result if X is uniformley distributed in [0,1] or X is uniformly distributed in [-1,1]...Kind regards $\chi$ $\sigma$
 
  • #4
Re: Transformation of random variable

I like Serena said:
Hi Jameson!

There is no probability for X being negative, so there's no need to include the negative part.
It is important to note that Y cannot be negative, because otherwise its square root would not be defined for part of the X domain.

And yes, that is the right direction.
Write $P[X \le \sqrt{y}]$ as an integral first, then differentiate.

I think that's the bit that was confusing me. I've seen a few solutions to this that all contain the $P[-\sqrt{y} \le X]$ term and it somehow disappears, but that's just because $P[X] \ge 0$.

So for the domain of $X$, this becomes $P[X \le \sqrt{y}]$ and after differentiating I think we end up with $\frac{1}{2 \sqrt{y}}$ however, I have seen an explanation that say the derivative is in fact:
$$f_{X}(\sqrt{y}) \cdot \frac{1}{2 \sqrt{y}}$$
Is that a more general way to think of it? How do I apply $f_{X}(\sqrt{y})$? I don't think I understand at how how we used that $X \text{ ~ } U(0,1)$. What if $X \text{ ~ } U(0,10)$?

I'm getting closer, thank you both!
 
  • #5
Re: Transformation of random variable

Jameson said:
I think that's the bit that was confusing me. I've seen a few solutions to this that all contain the $P[-\sqrt{y} \le X]$ term and it somehow disappears, but that's just because $P[X] \ge 0$.

So for the domain of $X$, this becomes $P[X \le \sqrt{y}]$ and after differentiating I think we end up with $\frac{1}{2 \sqrt{y}}$ however, I have seen an explanation that say the derivative is in fact:
$$f_{X}(\sqrt{y}) \cdot \frac{1}{2 \sqrt{y}}$$
Is that a more general way to think of it? How do I apply $f_{X}(\sqrt{y})$? I don't think I understand at how how we used that $X \text{ ~ } U(0,1)$. What if $X \text{ ~ } U(0,10)$?

I'm getting closer, thank you both!

If $X \text{ ~ } U(0,10)$, then with $0 \le x \le 10$ you get \(\displaystyle P[X \le x] = \int_0^x f_X(x)dx = \int_0^x \frac 1 {10-0} dx = \frac x {10}\).

And by differentiating \(\displaystyle P[X \le x] = \frac x {10}\), we find \(\displaystyle f_X(x) = \frac 1 {10}\), what we already expected of course.

So you need to differentiate after replacing $x$ with $\sqrt y$ (and of course you need to use $U(0,1)$ instead of $U(0,10)$).
 
  • #6
Re: Transformation of random variable

Ok, that makes sense. The range of $X$ will affect the density so it will add some scaling factor to the answer.

$$ P[X \le \sqrt{y}]=F_{X}(\sqrt{y})=\int_{0}^{\sqrt{y}}\frac{1}{1-0}dx$$

$$ f_{X}(\sqrt{y})=F'_{X}(\sqrt{y})=\frac{1}{2 \sqrt{y}}$$

Look good? :)

EDIT: I see another way to do it now. I was right before that the answer is also $f_{X}(\sqrt{y}) \cdot \frac{1}{2 \sqrt{y}}$. Now I should just apply the fact that the PDF is 1 in the given region and I get the same answer.
 
Last edited:
  • #7
Re: Transformation of random variable

Jameson said:
Ok, that makes sense. The range of $X$ will affect the density so it will add some scaling factor to the answer.

$$ P[X \le \sqrt{y}]=F_{X}(\sqrt{y})=\int_{0}^{\sqrt{y}}\frac{1}{1-0}dx$$

$$ f_{X}(\sqrt{y})=F'_{X}(\sqrt{y})=\frac{1}{2 \sqrt{y}}$$

Look good? :)

Excellent!
(Learning from $\chi$ $\sigma$. ;))

Did you verify that the integral of $f_Y(y)$ for all possible values of y is equal to 1?
 
  • #8
Re: Transformation of random variable

I like Serena said:
Excellent!
(Learning from $\chi$ $\sigma$. ;))

Did you verify that the integral of $f_Y(y)$ for all possible values of y is equal to 1?

Hmm, I actually don't know how to find $f_Y(y)$. All of this maneuvering has been to find $f_X(y)$. If I knew $F_Y(y)$ then I could just differentiate that though, but I don't know that.
 
  • #9
Re: Transformation of random variable

Jameson said:
Hmm, I actually don't know how to find $f_Y(y)$. All of this maneuvering has been to find $f_X(y)$. If I knew $F_Y(y)$ then I could just differentiate that though, but I don't know that.

You already found it.
$$F_Y(y) = P(Y \le y) = P(X \le \sqrt y)$$
(Thanks for removing the superfluous new line!)I guess you should add the condition that $0 \le y \le 1$, since for other values of $y$ it is zero.
 
Last edited:
  • #10
Oops. Just noticed something wrong.

It should be:
$$\begin{array}{lcll}f_X(x)&=&1 & \qquad \text{ if } 0 \le x \le 1 \\
P(X \le x) &=& F_X(x) = x & \qquad \text{ if } 0 \le x \le 1 \\
f_X(\sqrt y)&=&1 &\qquad \text{ if } 0 \le y \le 1 \\
P(X \le \sqrt y)&=&F_Y(y)=F_X(\sqrt y)=\sqrt y &\qquad \text{ if } 0 \le y \le 1 \\
f_Y(y)&=&\frac 1 {2 \sqrt y} &\qquad \text{ if } 0 \le y \le 1
\end{array}$$
 

Related to Transformation of random variable (uniform)

1. What is the transformation of a random variable?

The transformation of a random variable refers to the process of changing the distribution of a random variable by applying a function to its values.

2. What is a uniform random variable?

A uniform random variable is a continuous random variable where every possible outcome has an equal chance of occurring. It has a rectangular-shaped probability distribution.

3. How do you transform a uniform random variable?

To transform a uniform random variable, you can apply a function to its values, such as taking the square root or adding a constant. This will change the shape of its distribution.

4. What is the purpose of transforming a random variable?

The purpose of transforming a random variable is to change its distribution to better fit a specific statistical model or to make it easier to work with in calculations. It can also help to simplify data analysis and interpretation.

5. What are some common examples of transformations for a uniform random variable?

Some common examples of transformations for a uniform random variable include taking the logarithm, raising to a power, and adding or multiplying by constants. These transformations can result in a variety of different distributions, such as exponential or normal.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
933
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
621
  • Set Theory, Logic, Probability, Statistics
Replies
30
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
999
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
40
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
292
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
Back
Top