Context
As a follow up of this question, I would like to predict the connectivity of the so-called cosmic web in arbitrary dimensions.
The connectivity $\kappa$ is defined as the number of ridges connecting a given maxima to its surrounding saddles, which in turn therefore corresponds to $2 n_{\rm max}/ n_{\rm saddle}$ where $n_{\rm max}$ and $n_{\rm saddle}$ are the total number of maxima and saddles in the field.
This is how the cosmic web looks like in 3D:

so the motivation is to predict how many filaments are connected to a given node from first principes.
Attempt
As a starting point I am restricting myself to a Gaussian random field. For such fields it can be shown that the following code computes this ratio for an arbitrary dimension $d$.
d=3;
var = Table[ToExpression["x" <> ToString[i]], {i, d}];
mat = ConstantArray[1/(d (d + 2)) , {d, d}];
Do[mat[[i, i]] = 3/(d (d + 2)), {i, d}];
arg = Abs[Times @@ var] Abs[
Product[var[[i]] - var[[j]], {i, d}, {j, i - 1}]];
pdf = MultinormalDistribution[Table[0, {Length[mat]}], mat];
fun1 = Function[var // Evaluate,
Times @@ (Boole[# < 0] & /@ var) arg // Evaluate];
fun2 = Function[var // Evaluate,
Boole[Last[var] > 0] Times @@ (Most@(Boole[# < 0] & /@ var)) arg //
Evaluate];
2 Integrate[fun2 @@ var PDF[pdf, var],
Sequence @@ Map[{#, -Infinity, Infinity} &, var]]/
Integrate[fun1 @@ var PDF[pdf, var],
Sequence @@ Map[{#, -Infinity, Infinity} &, var]]
For instance it returns 4 for $d=2$ and
2 (18 Sqrt[2] + 29 Sqrt[3]) / (-18 Sqrt[2] + 29 Sqrt[3]) = 6.11
for $d=3$. It is strikingly close to a cubic face centred lattice, but with some level of impurity to the crystal.
for $d>3$ I have resorted to NIntegrate
2 d NIntegrate[fun2 @@ var PDF[pdf, var] // Evaluate,
Sequence @@ Map[{#, -Infinity, -1, 0, 1, Infinity} &, var] //
Evaluate, PrecisionGoal -> 20, MinRecursion -> 8]/
NIntegrate[fun1 @@ var PDF[pdf, var] // Evaluate,
Sequence @@ Map[{#, -Infinity, -1, 0, 1, Infinity} &, var] //
Evaluate,
PrecisionGoal -> 20, MinRecursion -> 8]
and I find 8.35 10.75 13.23 for $d$=4,5,6
Question
Is is possible to compute the ratio analytically for $d>3$?
FYI, for $d=4$ the integrant of the numerator looks like this
int = fun2 @@ var PDF[pdf, var]; int

Alternative Question
What options should one use with
NIntegrateso that the code works for $d>6$.
Scientifically, it would be of interest to go up to d=11 in the context of so-called landscape inflation.
As a test, I have tried the following brute force Monte Carlo:
d=5;
dat2 = ParallelTable[dat = RandomVariate[pdf, 150000];
{2 d (fun2 @@ # & /@ dat // Total), (fun1 @@ # & /@ dat //
Total)}, {25}]; // AbsoluteTiming
Mean@ dat2 // First[#]/Last[#] &
which is embarrassingly parallel but not very accurate.
So far I have
$\kappa^d$ = $4$, $6.11$, $8.35$, $10.73$, $13.23$, $15.85$ for $d=$ $2$, $3$, $4$, $5$, $6$, $7$ resp.
From inspection of $d\le 7$ we conjecture that it is closely approximated by
$$ \kappa^d= 2d+\left(\frac{2d-4}{7}\right)^{7/4}. $$
PS: I have now also asked this question on math.stackexchange

NIntegratewith a high precision, and useRootApproximantand cross your fingers. With a bit of luck, the analytic result is algebraic andRootApproximantwill be able to reconstruct it from its approximate numerical value. – AccidentalFourierTransform May 22 '18 at 14:28RootApproximantwas able to recover the correct expression. If you reduce the precision (say, from20to5), it fails. So you'll need several correct decimal places to get the correct result. – AccidentalFourierTransform May 22 '18 at 14:32d=3I find thatExpectation[fun2 @@ var, var \[Distributed] pdf]is faster thanIntegrate, by roughly 30%. Didn't have time to test it for largerdthough. Related: How to deal with complicated Gaussian integrals in Mathematica? – Jens May 25 '18 at 16:42Integratewith additional assumptions, but also could choose different methods such as FT of characteristic function. Not sure what it does under the hood in this case - and the speedup isn't enough to make largerdreally feasible anyway... – Jens May 25 '18 at 17:14