24
$\begingroup$

Supppse $X$ and $Y$ are standard uniformly distributed in $[0, 1]$, and they are independent, what is the PDF of $Z = Y / X$?

The answer from some probability theory textbook is

$$ f_Z(z) = \begin{cases} 1/2, & \text{if } 0 \le z \le 1 \\ 1/(2z^2), & \text{if } z > 1 \\ 0, & \text{otherwise}. \end{cases} $$

I am wondering, by symmetry, shouldn't $f_Z(1/2) = f_Z(2)$? This is not the case according to the PDF above.

$\endgroup$
8
  • $\begingroup$ What is the domain of $X$ and $Y$? $\endgroup$
    – Sobi
    Dec 8, 2015 at 13:47
  • $\begingroup$ en.wikipedia.org/wiki/Ratio_distribution $\endgroup$ Dec 8, 2015 at 13:54
  • 2
    $\begingroup$ Why would you expect this to be true? The density function tells you how tightly packed the probability is in the neighborhood of a point, and it is clearly more difficult for $Z$ to be near $2$ than $1/2$ (consider for instance that $Z$ can always be $1/2$ no matter what $X$ is, but $Z < 2$ when $X > 1/2$). $\endgroup$
    – dsaxton
    Dec 8, 2015 at 14:06
  • 2
    $\begingroup$ Possible duplicate of Distribution of a ratio of uniforms: What is wrong? $\endgroup$
    – Xi'an
    Dec 8, 2015 at 14:21
  • 3
    $\begingroup$ I don't think it's a duplicate, that question is seeking the PDF, here I have the PDF, I am just questioning its correctness (perhaps rather naively). $\endgroup$
    – qed
    Dec 8, 2015 at 14:29

6 Answers 6

23
$\begingroup$

The right logic is that with independent $X, Y \sim U(0,1)$, $Z=\frac YX$ and $Z^{-1} =\frac XY$ have the same distribution and so for $0 < z < 1$ \begin{align} P\left\{\frac YX \leq z\right\} &= P\left\{\frac XY \leq z\right\}\\ &= P\left\{\frac YX \geq \frac 1z \right\}\\ \left.\left.F_{Z}\right(z\right) &= 1 - F_{Z}\left(\frac 1z\right) \end{align} where the equation with CDFs uses the fact that $\frac YX$ is a continuous random variable and so $P\{Z \geq a\} = P\{Z > a\} = 1-F_Z(a)$. Hence the pdf of $Z$ satisfies $$f_Z(z) = z^{-2}f_Z(z^{-1}), \quad 0 < z < 1.$$ Thus $f_Z(\frac 12) = 4f_Z(2)$, and not $f_Z(\frac 12) = f_Z(2)$ as you thought it should be.

$\endgroup$
19
$\begingroup$

This distribution is symmetric--if you look at it the right way.

The symmetry you have (correctly) observed is that $Y/X$ and $X/Y = 1/(Y/X)$ must be identically distributed. When working with ratios and powers, you are really working within the multiplicative group of the positive real numbers. The analog of the location invariant measure $d\lambda=dx$ on the additive real numbers $\mathbb{R}$ is the scale invariant measure $d\mu = dx/x$ on the multiplicative group $\mathbb{R}^{*}$ of positive real numbers. It has these desirable properties:

  1. $d\mu$ is invariant under the transformation $x\to ax$ for any positive constant $a$: $$d\mu(ax) = \frac{d(ax)}{ax} = \frac{dx}{x} = d\mu.$$

  2. $d\mu$ is covariant under the transformation $x\to x^b$ for nonzero numbers $b$: $$d\mu(x^b) = \frac{d(x^b)}{x^b} = \frac{b x^{b-1} dx}{x^b} = b\frac{dx}{x} = b\, d\mu.$$

  3. $d\mu$ is transformed into $d\lambda$ via the exponential: $$d\mu(e^x) = \frac{de^x}{e^x} = \frac{e^x dx}{e^x} = dx = d\lambda.$$ Likewise, $d\lambda$ is transformed back to $d\mu$ via the logarithm.

(3) establishes an isomorphism between the measured groups $(\mathbb{R}, +, d\lambda)$ and $(\mathbb{R}^{*}, *, d\mu)$. The reflection $x \to -x$ on the additive space corresponds to the inversion $x \to 1/x$ on the multiplicative space, because $e^{-x} = 1/e^x$.

Let's apply these observations by writing the probability element of $Z=Y/X$ in terms of $d\mu$ (understanding implicitly that $z \gt 0$) rather than $d\lambda$:

$$f_Z(z)\,dz = g_Z(z)\,d\mu = \frac{1}{2}\begin{cases} 1\,dz = z\, d\mu, & \text{if } 0 \le z \le 1 \\ \frac{1}{z^2}dz = \frac{1}{z}\, d\mu, & \text{if } z > 1. \end{cases}$$

That is, the PDF with respect to the invariant measure $d\mu$ is $g_Z(z)$, proportional to $z$ when $0\lt z \le 1$ and to $1/z$ when $1 \le z$, close to what you had hoped.


This is not a mere one-off trick. Understanding the role of $d\mu$ makes many formulas look simpler and more natural. For instance, the probability element of the Gamma function with parameter $k$, $x^{k-1}e^x\,dx$ becomes $x^k e^x d\mu$. It's easier to work with $d\mu$ than with $d\lambda$ when transforming $x$ by rescaling, taking powers, or exponentiating.

The idea of an invariant measure on a group is far more general, too, and has applications in that area of statistics where problems exhibit some invariance under groups of transformations (such as changes of units of measure, rotations in higher dimensions, and so on).

$\endgroup$
1
  • 3
    $\begingroup$ Looks like a very insightful answer. It's a pity I don't understand it at the moment. I will check back later. $\endgroup$
    – qed
    Dec 8, 2015 at 16:40
10
$\begingroup$

Method 1: Let $X_1\sim U(0,1)$ and $X_2\sim U(0,1)$. Since $X_1$ and $X_2$ are independent, $$f_{X_1,X_2}(x_1,x_2)=f_{X_1}(x_1).f_{X_2}(x_2)=1.$$

Define $Y_1=\frac{X_1}{X_2}$ and $Y_2=X_2$. It means that $Y_1=u_1(X_1,X_2)$ and $Y_2=u_2(X_1,X_2)$ where $u_1(x_1,x_2)=\frac{x_1}{x_2}$ and $u_2(x_1,x_2)=x_2$. Now, let's find $X_1,X_2$ in terms of $Y_1,Y_2$. We get: $$X_1=Y_1Y_2 \mbox{ and } X_2=Y_2.$$ In other words, $X_1=v_1(Y_1,Y_2)$ and $X_2=v_2(Y_2)$ where $v_1(y_1,y_2)=y_1y_2$ and $v_2(y_1,y_2)=y_2$.

Calculate the Jacobian and we have $$J= \det\left[\begin{matrix}\frac{\partial v_1}{\partial y_1} & \frac{\partial v_1}{\partial y_2} \\ \frac{\partial v_2}{\partial y_1} & \frac{\partial v_2}{\partial y_2} \end{matrix}\right] =\det\left[\begin{matrix}y_2 & y_1 \\ 0 & 1 \end{matrix}\right]=y_2. $$ So we have $$f_{Y_1,Y_2}(y_1,y_2)=f_{X_1,X_2}(v_1(y_1,y_1),v_2(y_1,y_2)).|J| = y_2.$$

Now, we can calculate the marginal pdf of $Y_1$. Note that the region $$\{(x_1,x_2)|0<x_1<1,0<x_2<1\}$$ maps to the region $$\{(y_1,y_2)|y_1>0,y_2<\min\{1,1/y_1\}\}.$$

enter image description here

So we have:

$$f_{Y_1}(y_1)=\int f_{Y_1,Y_2}(y_1,y_2)dy_2=\left\{\begin{matrix} \int_{0}^{1}y_2dy_2 & 0<y_1<1\\ \int_{0}^{\frac{1}{y_1}}y_2dy_2 & y_1>1\end{matrix}\right. = \left\{\begin{matrix} \frac{1}{2} & 0<y_1<1 \\ \frac{1}{2y_1^2} & y_1>1.\end{matrix}\right.$$

Method 2: Let $X_1\sim U(0,1)$ and $X_2\sim U(0,1)$. Since $X_1$ and $X_2$ are independent, $$f_{X_1,X_2}(x_1,x_2)=f_{X_1}(x_1).f_{X_2}(x_2)=1.$$ Let $Z=\frac{X_2}{X_1}$. We have

$$F(z)=P(Z\le z) = P(\frac{X_2}{X_1} \le z) = P(X_2\le zX_1).$$

Note that if $0<z<1$, then the slope of the line $X_2=zX_1$ is less than 1 and this line is in region 1 (below the line $X_2=X_1$), otherwise it will be in region 2 (above the line $X_2=X_1$) (See the picture).

enter image description here

So we have $$ F(z)= P(X_2\le zX_1)=\left\{ \begin{matrix} \int_{0}^{1}\int_{0}^{zx_1} 1dx_2dx_1 & 0<z<1 \\ \int_{0}^{1/z}\int_{0}^{zx_1} 1dx_2dx_1+\int_{1/z}^{1}\int_{0}^{1} 1dx_2dx_1 & z>1 \end{matrix}\right.$$ $$ =\left\{ \begin{matrix} \frac{1}{2}z & 0<z<1 \\ 1-\frac{1}{2z} & z>1 \end{matrix}\right.$$

So, the pdf is

$$ f(z)=\left\{ \begin{matrix} \frac{1}{2} & 0<z<1 \\ \frac{1}{2z^2} & z>1 \end{matrix}\right.$$

$\endgroup$
3
  • 1
    $\begingroup$ I appreciate detailed answers like this. Very helpful. $\endgroup$ May 23, 2020 at 0:51
  • 1
    $\begingroup$ Method 2 helped me beyond measure. Finding the limits of integration did not make sense until you showed the multiple discontinuities at z=1 and x=1/z. $\endgroup$
    – ui_90jax
    Nov 20, 2020 at 14:37
  • $\begingroup$ draw a picture!! +1 $\endgroup$
    – tef2128
    Jan 7, 2022 at 15:32
9
$\begingroup$

If you think geometrically...

In the $X$-$Y$ plane, curves of constant $Z = Y/X$ are lines through the origin. ($Y/X$ is the slope.) One can read off the value of $Z$ from a line through the origin by finding its intersection with the line $X=1$. (If you've ever studied projective space: here $X$ is the homogenizing variable, so looking at values on the slice $X=1$ is a relatively natural thing to do.)

Consider a small interval of $Z$s, $(a,b)$. This interval can also be discussed on the line $X=1$ as the line segment from $(1,a)$ to $(1,b)$. The set of lines through the origin passing through this interval forms a solid triangle in the square $(X,Y) \in U = [0,1]\times[0,1]$, which is the region we're actually interested in. If $0 \leq a < b \leq 1$, then the area of the triangle is $\frac{1}{2}(1-0)(b-a)$, so keeping the length of the interval constant and sliding it up and down the line $X=1$ (but not past $0$ or $1$), the area is the same, so the probability of picking an $(X,Y)$ in the triangle is constant, so the probability of picking a $Z$ in the interval is constant.

However, for $b>1$, the boundary of the region $U$ turns away from the line $X = 1$ and the triangle is truncated. If $1 \leq a < b$, the projections down lines through the origin from $(1,a)$ and $(1,b)$ to the upper boundary of $U$ are to the points $(1/a,1)$ and $(1/b,1)$. The resulting area of the triangle is $\frac{1}{2}(\frac{1}{a} - \frac{1}{b})(1-0)$. From this we see the area is not uniform and as we slide $(a,b)$ further and further to the right, the probability of selecting a point in the triangle decreases to zero.

Then the same algebra demonstrated in other answers finishes the problem. In particular, returning to the OP's last question, $f_Z(1/2)$ corresponds to a line that reaches $X=1$, but $f_Z(2)$ does not, so the desired symmetry does not hold.

$\endgroup$
5
$\begingroup$

Just for the record, my intuition was totally wrong. We are talking about density, not probability. The right logic is to check that

$$ \int_1^k f_Z(z) dz = \int_{1/k}^1 f_Z(z) = \frac{1}{2}(1 - \frac{1}{k}) $$,

and this is indeed the case.

$\endgroup$
1
$\begingroup$

Yea the link Distribution of a ratio of uniforms: What is wrong? provides CDF of $Z=Y/X$. The PDF here is just derivative of the CDF. So the formula is correct. I think your problem lies in the assumption that you think Z is "symmetric" around 1. However this is not true. Intuitively Z should be a skewed distribution, for example it is useful to think when Y is a fixed number between $(0,1)$ and X is a number close to 0, thus the ratio would be going to infinity. So the symmetry of distribution is not true. I hope this help a bit.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.