Confusion related to calculation of conditional distribution I have this confusion related to the calculation of a conditional distribution
suppose $y_n = N(0,w)$
$p(o_n|y_n) = N(D.y_n,\phi)$
How do I calculate 
$p(y_n|o_n)$
Actually I was reading this paper related to imputation of missing data exploiting the spatial correlation between data http://astro.temple.edu/~tua86150/Lou_IJCAI_11.pdf. However, while going through the paper, I didn't get this part where it calculate $E(y_n|o_n)$. Any suggestions will be appreciated a lot.
Actually, $y_n$ are treated as latent variables in the paper and {$y_n,o_n$} represents a linear-Gaussian latent variable model. The latent variables {$y_n$} are treated as independent
 A: Keeping with your post, I am using $p(x)$ to denote the probability density function of the random variable $X$.
Let $Y \sim N(0,w)$ with pdf $p_y(y)$ and $O|Y \sim N(D\cdot y, \phi)$ with pdf $p_{o|y}(o|y)$.  Just like with probabilities of events, we can write the joint pdf of the random variables $O$ and $Y$ as 
$$
p(o,y)=p(o|y)\cdot p(y)
$$
It is helpful to note that the conditional pdf of $Y|O$ is proportional to the joint pdf of $Y$ and $O$. This is written as
$$
p(y|o)\propto p(o,y)
$$
and just means if you fix the value of $O$ and consider $p(y|o)$ and $p(o,y)$ as functions of $y$, they differ by a constant that is independent of $Y$.
Now for the standard trick in finding conditional distributions.  We are only concerned with terms in the pdf that have an $y$ in them so we can drop multiplicative constants and terms that only have $o$.  Thus, 
$$
\begin{eqnarray}
  \ p(y|o) &\propto& p(o,y) \nonumber\\
  &\propto& p(o|y)\cdot p(y) \nonumber\\
  &\propto& \exp\{ -\frac{(o-Dy)^2}{2\phi}\} \exp\{ -\frac{y^2}{2w} \} \nonumber\\
  &\propto& \exp\{ -\frac{y^2(D^2w+\phi) - 2Dwyo}{2w\phi} \} \nonumber\\
  &\propto& \exp\{ -\frac{y^2 - 2y\frac{Dwo}{D^2w+\phi}}{\frac{2w\phi}{D^2w+\phi}} \} \nonumber\\
  &\propto& \exp\{ -\frac{y^2 - 2y\frac{Dwo}{D^2w+\phi} + \Bigg(\frac{Dwo}{D^2w+\phi} \Bigg)^2}{2\frac{w\phi}{D^2w+\phi}} \} \nonumber\\
\end{eqnarray}
$$
One of the defining properties of a pdf is that it must integrate to 1. With this fact and the above calculation, the distribution of $Y|O$ is a normal distribution with mean $\frac{Dwo}{D^2w+\phi}$ and variance $\frac{w\phi}{D^2w+\phi}$.
Note: The strategy used to find this pdf is common in Bayesian statistics.  The great thing about it is that if you know the joint pdf of two RV's, it is easy to find the conditional pdf of an RV up to a constant.  This constant may be important and is often difficult to find, but in this case it was clear what the conditional distribution is.
