If we know the density of $f(x\mid y=1)$ and $f(x\mid y=0)$, how to get the distribution of $f(x\mid y)$?

51 Views Asked by At

For random variable $X\sim N(0,\sigma^2)$ and $Y$, here $Y\sim \operatorname{Ber}(p)$ and $$X\mid Y\sim Y N(0,\sigma_1^2)+(1-Y)N(0,\sigma_2^2)$$

Another question is if I know the density of $f(x\mid y=1)$ and $f(x\mid y=0)$, how to get the distribution of $f(x\mid y)$? Is it

$$f(x\mid y)=\Pr(Y=1)f(x\mid y=1)+\Pr(Y=0)f(x\mid y=0) \text{?}$$