How to evaluate multivariate normal integral with conditional upper bounds - Cross Validated most recent 30 from stats.stackexchange.com 2019-07-21T07:01:48Z https://stats.stackexchange.com/feeds/question/397610 http://www.creativecommons.org/licenses/by-sa/3.0/rdf https://stats.stackexchange.com/q/397610 0 How to evaluate multivariate normal integral with conditional upper bounds Dan Y https://stats.stackexchange.com/users/83419 2019-03-14T23:33:09Z 2019-03-15T01:17:48Z <p>Suppose I have independent normally distributed random variables: <span class="math-container">$x_i \sim N(0,1)$</span>. In my actual application, <span class="math-container">$i=1,\ldots,30$</span>, but for my example here I'll use <span class="math-container">$i=1,2,3$</span>.</p> <p>I want to evaluate (either analytically with math or approximately with a simulation technique) the probability that they occur in order, after being "adjusted" by some real-valued, non-random scalars that I will call <span class="math-container">$a, b, c$</span>. </p> <p><strong>For example, what is: <span class="math-container">$\ \Pr(x_3 + c &lt; x_2 + b &lt; x_1 + a)$</span>?</strong></p> <p>Here's what I've got so far, where <span class="math-container">$I(\cdot)$</span> is an indicator function, and <span class="math-container">$\phi$</span> and <span class="math-container">$\Phi$</span> are the standard normal pdf and cdf:</p> <p><span class="math-container">\begin{align*} &amp;\Pr(x_3 + c &lt; x_2 + b &lt; x_1 + a) \\ &amp;= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} I(x_3 + c &lt; x_2 + b) \times I(x_2 + b &lt; x_1 + a) \phi(x_3)\phi(x_2)\phi(x_1) \, dx_3 \, dx_2 \, dx_1 \\ &amp;= \int_{-\infty}^{\infty} \phi(x_1) \left[ \int_{-\infty}^{\infty} I(x_2 + b &lt; x_1 + a) \phi(x_2) \left( \int_{-\infty}^{\infty} I(x_3 + c &lt; x_2 + b) \phi(X_3) \, dx_3 \right) \, dx_2 \right] \, dx_1 \\ &amp;= \int_{-\infty}^{\infty} \phi(x_1) \int_{-\infty}^{x_1 + a - b} \phi(x_2) \int_{-\infty}^{x_2 + b - c} \phi(x_3) \, dx_3 \, dx_2 \, dx_1 \\ &amp;= \int_{-\infty}^{\infty} \phi(x_1) \int_{-\infty}^{x_1 + a - b} \Phi(x_2 + b - c) \phi(x_2) \, dx_2 \, dx_1 \\ &amp;= \ \ldots ? \end{align*}</span></p> <p>A solution to this, or even just a pointer to a simulation method that I can learn about (i.e., does GHK work here?) would be very helpful - thank you!</p> https://stats.stackexchange.com/questions/397610/-/397622#397622 0 Answer by Dan Y for How to evaluate multivariate normal integral with conditional upper bounds Dan Y https://stats.stackexchange.com/users/83419 2019-03-15T01:15:11Z 2019-03-15T01:15:11Z <p>OK - maybe I have an answer in the spirit of GHK simulation. </p> <p>It would still be helpful if someone could comment on the correctness of this answer...</p> <p><span class="math-container">\begin{align} &amp;\Pr(x_3+c &lt; x_2+b &lt; x_1+a) \\ &amp;= \int_{-\infty}^\infty \Pr(x_3+c &lt; x_2+b &lt; x_1+a \big| x_1) \phi(x_1)\,dx_1 \\ &amp;= \int_{-\infty}^\infty \Pr(x_3+c &lt; x_2+b \big| x_2+b &lt; x_1+a)\Pr(x_2+b &lt; x_1+a \big| x_1) \phi(x_1)\,dx_1 \\ \end{align}</span></p> <p>Approximate this integral as folows:</p> <ol> <li>repeat steps 2-5 R times:</li> <li>draw <span class="math-container">$x_1^r$</span> from <span class="math-container">$\phi(x_1)$</span></li> <li>calculate <span class="math-container">$\Phi(x_1^r+a-b)$</span></li> <li>draw <span class="math-container">$x_2^r$</span> from <span class="math-container">$\bar{\phi}(x_2)$</span> where <span class="math-container">$\bar{\phi}$</span> is a standard normal truncated above at <span class="math-container">$x_1^r+a-b$</span></li> <li>calculate <span class="math-container">$\Phi(x_2^r+b-c)$</span></li> <li>calculate <span class="math-container">$\hat{\Pr}(x_3+c &lt; x_2+b &lt; x_1+a) \approx \frac{1}{R}\sum_{r=1}^R \Phi(x_1^r+a-b)\Phi(x_2^r+b-c)$</span></li> </ol>