TITLE: Multivariate gaussian integral over positive reals
QUESTION [20 upvotes]: The multivariate gaussian integral over the whole $\mathbf{R}^n$ has closed form solution
$$P = \int_{\mathbf{x} \in \mathbf{R}^n} \exp \left(-\frac12 \mathbf{x}^T \mathbf{A} \mathbf{x}\right)\,d\mathbf{x} = \sqrt{\frac{(2\pi)^n}{\det \mathbf{A}}}$$
where $\mathbf{A}$ is a symmetric positive-definite covariance matrix.
However, I need to solve the integral for positive reals $\{\mathbf{x} \in \mathbf{R}^n :\, \mathbf{x}_i \geq 0\ \forall i\}$ only and in at least 6 dimensions:
$$P = \int_{\{\mathbf{x} \in \mathbf{R}^n :\, \mathbf{x}_i \geq 0\ \forall i\}} \exp \left(-\frac12 \mathbf{x}^T \mathbf{A} \mathbf{x}\right)\,d\mathbf{x}$$
For diagonal $\mathbf{A}$ with zero covariance, a solution has been published.
For non-diagonal covariance, my approach so far is to apply affine coordinate transforms to rotate and rescale the gaussian ellipsoid into the unit sphere (see here).
In two dimensions, the solution to the integral then reduces to comparing the area enclosed by the transformed positive coordinate axes (blue) to the area of the unit circle:

In three dimensions, the solution is given by the ration of the surface area of an enclosed spherical polygon to the surface area of the unit sphere.
In four dimensions, this approach becomes quite complicated, and I don't know how to use the usual spherical excess formulas for higher dimensions.
Any ideas or alternative approaches? Is there a multivariate error function? Any treatment on the multivariate half normal distribution?

Addition (2018-12-03):
Thank you Przemo for your solution to the problem for $n=2, 3$. While I had no trouble following your derivation in 2D, I'm stuck with the derivation of your intermediate step for $n=3$. I mainly tried two approaches:

Completing the square in one variable, say $x$, leaves me with
$$\int_{\mathbb{R}_+^2} \mathrm{d}y\mathrm{d}z \exp\left(-\frac{1}{2} \frac{\mathrm{det}\,A_3}{\mathrm{det}\,A_2}z^2\right) \exp\left(-\frac{1}{2} \frac{\mathrm{det}\, A_2}{a}(y-m z)^2\right) \left[1 - \mathrm{erf}\left(\frac{a_{12}y+a_{13}z}{\sqrt{2a}}\right) \right] $$
where $A_2=\begin{pmatrix} a & a_{12}\\ & b\end{pmatrix}$, $A_3$ as you defined it, and $m$ is a function of the coefficients of the matrices. However, I do not know how to proceed from there: expanding the error function to do the integral in y, say, is a nightmare due to the constant term in z; I also did not find a way to do a coordinate transform à la $s=a_{12}y+a_{13}z$ or something similar.
Indeed, your intermediate solution looks more like you were able to complete the square in two of the variables independently; but what happened to the cross-term? I cannot find a factorisation of the exponent that would allow me to complete two integrals over the half-line with only one variable left in the error function yielded by the integral. 

Any help / hint would be greatly appreciated! Thank you in advance.

REPLY [2 votes]: For Przemo's example with $n=5$, define a higher arcsine:
$$\arcsin(a,b,c) = \int_0^b \frac { \arcsin\left( a \beta c / v / w \right) } { \sqrt{1-\beta^2} } d\beta$$
$$\text{where}\; v = \sqrt{ 1-a^2-\beta^2 },\; w = \sqrt{ 1-\beta^2-c^2 },$$
and the orthoscheme volume:
$$V( a, b, c, d ) = \frac {\pi^2} {60}
  + \frac {\pi} {30} \left( \arcsin( a ) + \arcsin( b ) + \arcsin( c ) + \arcsin( d ) \right)
  + \frac {1} {15} \left(
    \arcsin( a ) \arcsin( c ) + \arcsin( a ) \arcsin( d ) + \arcsin( b ) \arcsin( d )
    + \arcsin( a, b, c ) + \arcsin( b, c, d ) \right)
.$$
Then the (normalized) orthant probability for A is $\frac{15S}{8\pi^2}$ where:
$$ S = 8 \cdot V \left( abc, -\sqrt{\frac{1-a}{2}}, -\frac{1+a-2ab}{2(1-ab)}, -\frac{1-a}{2(1-ab)} \right) \\
+ 16 \cdot V \left( abc, -\sqrt{\frac{1-ab}{2}}, -\frac{1}{2}\sqrt{\frac{1-a}{1-ab}}, -\frac{1}{2}\sqrt{\frac{1+a-2ab}{1-ab}} \right)
. $$
E.g., for $a = 0.3, b = 0.2, c = 0.1$, we get $\approx 0.049972036321177378010658463826149025346$.