# How to compute conditional expectation of multivariate normal

$(x_1, x_2, x_3)$~$N(0, \Sigma(\sigma_{ij}))$

then how to calculate $$E[x_2| x_1\leq a, x_3\leq b]$$

• What happened to $x_3$? or is it a 2D problem? – Alex C Jan 17 '17 at 3:16
• sorry, I made a mistake, pls see the updated version @Alex C – user6703592 Jan 17 '17 at 3:21
• equivalently, I want to know how to solve $E[z_1 | z_1\leq a, z_2+z_1 \leq b]$ if $z_1, z_2$ are iid $N(0,1).$ – user6703592 Jan 17 '17 at 3:23

Your expectation is given by \begin{align*} E[x_2 \:|\: x_1 \leq a, x_3 \leq b] &= \int_{-\infty}^\infty x_2 f(x_2 \:|\: x_1 \leq a, x_3 \leq b) \:dx_2 \end{align*}
To solve this problem you first need the pdf of $x_2 \:|\: x_1 \leq a, x_3 \leq b$. This is given by $$f(x_2 \:|\: x_1 \leq a, x_3 \leq b) = \frac{\int_{-\infty}^a\int_{-\infty}^bf_x(x_1,x_2,x_3) \:dx_3dx_1}{P[x_1 \leq a, x_3 \leq b]}$$ where $$P[x_1 \leq a, x_3 \leq b] = \int_{-\infty}^a\int_{-\infty}^\infty\int_{-\infty}^bf_x(x_1,x_2,x_3)\:dx_3dx_2dx_1$$ and the joint probability distribution $f_x$ is given by $$f_x(x_1,x_2,x_3) = \frac{\mathrm{exp}\left(-\frac{1}{2}x^T\Sigma^{-1}x\right)}{\sqrt{(2\pi)^3|\Sigma|}}$$
• @user6703592 No, there's no closed form solution for the integral. However, there are implementations which implement the multivariate normal cdf, which you can use. For example, MATLAB's mvncdf. Then perform a numerical integration of the first integral over $x_2$. – msitt Jan 18 '17 at 0:37