pdf from a set of conditional pdfs I have an interesting problem, i have seen in many text books ways of calculating conditional pdfs but not many where given a set of conditional pdfs for a variable we wish to calculate it's pdf. In particular i'm interested in problems with mixed types. As an example suppose the random variable $X$ takes values in the set $\{-2,2\}$ with equal probability. Given $X=x$ the random variable $Y \sim N(x,1)$. How can i generate the pdf for $Y$? My approach would be this. 
To calculate the cdf $F_{Y}(y) = P(Y \leq y) = P(Y \leq y  \cap X=-2) + P(Y \leq y \cap X=2) = P(Y \leq y|X=-2)P(X=-2)+P(Y \leq y|X=2)P(X=2)$. 
Since i have the conditional cdf's i can calculate $F_{Y}(y)$.
Once i have $F_{Y}(y)$ i can differentiate to calculate $f_{y}(y)$. Now i know there would be no analytical solution given that the conditional distribution of $Y$ is normal but is this approach the right way to go? Are there any other techniques commonly used?
 A: I think you are making this too complicated.  You simply need to find:
\begin{eqnarray*}
f_{Y}(y) & = & \int_{-\infty}^{\infty}f_{Y|X}(y|x)f_{X}(x)dx\\
 & = & \int_{-\infty}^{\infty}f_{X,Y}(x,y)dx
\end{eqnarray*}
if your goal is to obtain the PDF of $f_Y(y)$.
So in your case, you can start with:
\begin{eqnarray*}
f_{X}(x) & = & \begin{cases}
1/2 & x=-2\\
1/2 & x=2\\
0 & otherwise
\end{cases}
\end{eqnarray*}
and 
\begin{eqnarray*}
f_{Y|X}(y|x) & = & \frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}(y-x)^{2}},\,y\in(-\infty,\infty);x={\{-2,2}\}
\end{eqnarray*}
So, you can compute:
\begin{eqnarray*}
f_{X,Y}(x,y) & = & f_{Y|X}(y|x)f_{X}(x)\\
 & = & \begin{cases}
\frac{1}{2\sqrt{2\pi}}e^{-\frac{1}{2}(y+2)^{2}} & x=-2,\,y\in(-\infty,\infty)\\
\frac{1}{2\sqrt{2\pi}}e^{-\frac{1}{2}(y-2)^{2}} & x=2,\,y\in(-\infty,\infty)\\
0 & \text{otherwise}
\end{cases}
\end{eqnarray*}
Now, you can find the marginal PDF, $f_Y(y)$ over $y\in(-\infty,\infty)$ by "summing out" $X$:
\begin{eqnarray*}
f_{Y}(y) & = & \sum_{x=\{-1,2\}}f_{X,Y}(x,y)\\
 & = & f_{X,Y}(-2,y)+f_{X,Y}(2,y)\\
 & = & \frac{1}{2\sqrt{2\pi}}e^{-\frac{1}{2}(y+2)^{2}}+\frac{1}{2\sqrt{2\pi}}e^{-\frac{1}{2}(y-2)^{2}}\\
 & = & \frac{1}{2}\left[\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}[(y+2)-0]^{2}}+\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}[(y-2)-0]^{2}}\right]\\
 & = & \frac{1}{2}\left[\phi(y+2)+\phi(y-2)\right]
\end{eqnarray*}
where $\phi(\cdot)$ is the PDF of a Standard Normal Random Variable.
