Conditional and marginal densities with mixed discrete and continuous random variables

81 Views Asked by At

I am having trouble finding the distribution of X, $f(x)$. I have two random variables, $X$ and $Y$. $Y$ is discrete and can take on a value of 1 or 2 with certain probabilities. The distribution of $X$ given $Y = y$ is Normal$(y,y^2)$. It's easy to see that the distribution of $f(x|Y=y)$ is $$f(x|Y = y) = \begin{cases} \frac{1}{\sqrt{2\pi}}e^{-(x-1)^2} \text{ if $Y = 1$} \\ \frac{1}{\sqrt{8\pi}}e^{-\frac{(x-2)^2}{4}} \text{ if $Y = 2$}. \end{cases}$$ What I am so stuck on is how I can go about finding $f(x)$ alone.

I have that $$P(Y = y | X = x)= \frac{f(x|Y=y)P(Y = y)}{f(x)}$$.

So you could rearrange that for $f(x)$ I think, if you could find the probability $P(Y =y|X = x)$. I am stuck on how to find that probability and $f(x)$ and am wondering if there might be something very obvious I am missing, or else I am wrong somewhere and that's why I am stuck.