1

I'm confused about problems where we calculate a PDF conditioned on an event.

Consider this simple problem:

We have two random variables, X and Y, X is uniformly distributed on [a,b], and Y is uniform on [a,X]. We want to find the PDF of f(x|Y>y').

What's the best approach to calculate this?

An approach that comes to my mind is to define this PDF as the derivative of its CDF: $$ f(x|Y>y') = \frac{d}{dx}Pr(X<x|Y>y') = \frac{d}{dx}\left[\frac{Pr(X<x,Y>y')}{Pr(Y>y')}\right]=\frac{d}{dx}\left[\frac{\int_{a}^{x}\int_{y'}^{b}{f(x,y)dydx}}{\int_{y'}^{b}{f_{y}(y)dy}}\right] $$ And we know that: $$ f(y|x) = \begin{cases} \frac{1}{x-a} &a<y<x \\ 0 & \mbox{elsewhere} \end{cases} $$

$$ f(x,y) = f_x(x)*f(y|x) = \begin{cases} \frac{1}{(x-a)(b-a)} &a<y<x<b \\ 0 & \mbox{elsewhere} \end{cases} $$ $$ f_y(y) = \begin{cases} \int_{y}^{b}\frac{1}{(x-a)(b-a)}dx &a<y \\ 0 & \mbox{elsewhere} \end{cases} $$ Is this approach correct? Is there a better approach that's more straightforward?

  • 1
    Two such random variables don't exist. – whuber Jun 15 '23 at 13:57
  • I'm wondering whether you might have mis-worded the question. If X and Y are uniformly distributed, this implies their distributions are independent of one and other. That means, given they have the same support, it cannot be true that X is always larger than Y.

    I'm wondering whether maybe you meant to ask something like "given that X,Y are distributed in this way, what if we are told X>Y, i.e. what is p(X|X>Y)" ?

    – gazza89 Jun 15 '23 at 14:01
  • @whuber You are right. I've changed the definition of their distributions. now I think it should make sense – MohammadAli Zeraatkar Jun 15 '23 at 14:30
  • The best approach, IMHO, is to draw a diagram of the events in question. The appropriate conditional probabilities are ratios of areas in that diagram. – whuber Jun 15 '23 at 15:41
  • @whuber I think we should be more forgiving of the OP's mispunctuation and read the problem as asking "We have two random variables $X$ and $Y$. $X$ is uniformly distributed on $[a,b]$, and $Y$ is uniform on $[a,X]$. We want to find $f_{X\mid Y>y}(x\mid Y>y)$." – Dilip Sarwate Jul 20 '23 at 13:06
  • @Dilip Yes, that's what the question now says. – whuber Jul 20 '23 at 13:58

1 Answers1

0

Yes, I think your approach is correct.

Perhaps a slightly simpler way to see this would be to note $f_{X|Y}(x|y) = \frac{f_{X,Y}(x,y)}{f_Y(y)}$ and then to integrate $y$ over $(y', b]$.
This would give $\frac{\int_{(y', b]} f_{X,Y}(x,y) dy}{\int_{(y', b]} f_Y(y) dy}= \frac{\int_{y'}^b f_{X,Y}(x,y) dy}{\int_{y'}^b f_Y(y) dy}$ which, by the Fundamental Theorem of Calculus, is the same as the derivative of the CDF you gave.

A side note, whuber suggests that a simple geometric approach could work as well, but I don't see it; could they elaborate?

djr
  • 31
  • Because $a$ and $b$ just determine location and scale, it suffices to analyze one case, of which the simplest is $a=0,$ $b=1.$ By applying the concepts explained at https://stats.stackexchange.com/a/584907/919 you can immediately see (in the drawing) that the conditional density of $x$ is supported on $[y^\prime,1]$ and must be proportional to $(x-y^\prime)/x$ on that interval. That's an answer right there. If you need the constant of proportionality, computing the integral is elementary: $\int_{y^\prime}^1(x-y^\prime)/x,\mathrm dx = 1-y^\prime+y^\prime\log(y^\prime).$ – whuber Jul 18 '23 at 16:13
  • BTW, the question changed after I posted my original comment. The first version of the question stated $(X,Y)$ had a uniform distribution. That's considerably easier to analyze. – whuber Jul 18 '23 at 16:20
  • 1
    Thanks for that link. And yes, I agree $(X,Y)$ being uniformly distributed is certainly much easier! – djr Jul 18 '23 at 16:25