The question is : Suppose we first sample $X \sim N(0, 1)$ and then sample $Y \sim N(X, 1)$. What is the probability that $P(Y \leq 2)$?
I know how to sample the $X$ distribution, but I'm not sure how to get the $Y$ distribution based on $X$.
The question is : Suppose we first sample $X \sim N(0, 1)$ and then sample $Y \sim N(X, 1)$. What is the probability that $P(Y \leq 2)$?
I know how to sample the $X$ distribution, but I'm not sure how to get the $Y$ distribution based on $X$.
Copyright © 2021 JogjaFile Inc.
$X\sim N(0,1)$ and $Y|(X=x)\sim N(x,1)$ as Gabriel Romon pointed out.
We are in the continuous case so we have that $f_{XY}(x,y)=f_{Y|X}(y|x)f_X(x)$.
$f_X(x)=\frac{1}{\sqrt{2\pi}}e^{\frac{-x^2}{2}}$
$f_{Y|X}(y|x)=\frac{1}{\sqrt{2\pi}}e^{-\frac{(y-x)^2}{2}}$
$\implies f_{XY}(x,y)=\frac{1}{2\pi}e^{-\frac{2x^2+y^2-2xy}{2}}$
and $f_Y(y)=\int f_{XY}(x,y)dx$.
Finally, $P(Y\leq 2)=\int_{-\infty}^2f_Y(y)dy$. You'll have to do the last integrals yourself.