1
$\begingroup$

As the title says, I'm trying to find the probability density function of $Y\sim \text{Unif}(0,X)$ where $X\sim \text{Unif}(0,a)$ and $a>0$.

Since both variable are uniformly distributed, I know $p_X(x) = \frac{1}{a}$ and that the conditional pdf of $Y$ given $X=x$ is $p_Y(y \mid X=x) = \frac{1}{x}$.

I'm computing \begin{equation} p_Y(y) = \int_{-\infty}^{\infty} p_X(x) \: p_Y(y \mid X=x) dx = \int_{0}^{a} \frac{1}{a} \frac{1}{x} dx = \frac{1}{a} \int_{0}^{a} \frac{1}{x} dx \end{equation}

but $\frac{1}{x} $ is not integrable in the interval $[0,a]$. What am I overlooking?

I'm asking this because for a side project I'm intuitively generating a skewed distribution in $[0,a]$ by doing random(0,random(0,2)) but was curious to prove what the resulting distribution would analytically be.

Thanks in advance!

$\endgroup$
2
  • $\begingroup$ Perhaps you could try shifting the distribution to the right, so that $X$ is uniform on $(1,a+1)$ and $Y$ on $(1,X)$. $p_X(x)$ would be the same and $\frac{1}{x}$ would be integrable in $[1,a+1]$. $\endgroup$
    – Patricio
    May 12, 2021 at 16:55
  • $\begingroup$ Haven't thought of this, I'll give it a try as a different approach. Thanks! $\endgroup$ May 12, 2021 at 18:07

2 Answers 2

1
$\begingroup$

You need to consider the fact that $Y$ is always less than $X$. The conditional density is actually $$f_{Y|X}(y|x) = \begin{cases} \frac{1}{x} & 0 < y < x <a \\ 0 &\text{otherwise}\end{cases}$$ The marginal density then becomes: $$f_Y(y) = \frac{1}{a} \int_y^a \frac{1}{x} \: dx = \frac{\log(a) - \log(y)}{a}$$

$\endgroup$
1
  • $\begingroup$ Yup, you're right, forgot about the lower extreme which was the one giving me problems. Thanks! $\endgroup$ May 12, 2021 at 18:09
0
$\begingroup$

$p(y \mid X=x)$ is $\frac{1}{x}$ only when $0 < y < x$. So the integral with respect to $x$ should actually be $\int_y^a$ instead of $\int_0^a$.

$\endgroup$
1
  • $\begingroup$ oh yes, I knew it was going to be something like this. x must be greater than y $\endgroup$ May 12, 2021 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .