The results for these 6-dimensional cases are roughly the same in
version 8 as they are in version 7. There are, however, ways to get more
precise results in version 8 which will be shown below. We will look
into how these can be incorporated directly into CDF for the future.
There are some important issues to keep in mind with the computation of
CDFs so far out in the tails of higher dimenional normal. For 2 and 3
dimensional normals, special case code is now used in version 8 which
gets more precise results than in version 7 in your examples. In higher
dimensions the methodology requires an (n-1)-dimensional numeric
integral. The results obtained by CDF in the 6-dimensional examples sent
are good to about 7 or 8 digits, however they are nearly 1 and so
subtracting them from 1 cancels most, if not all, of the significant
digits.
The following approach to computing the values you are after was
provided by my colleague Sasha Pavlyk and uses the new SurvivalFunction
and MarginalDistribution functions from version 8 to effectively remove
pieces of probability outside the CDF region. The idea is to shave off
portions of the space by using lower dimensional marginal survival
functions. These would include marginals of dimension 1 through 5, but
the contributions from the higher dimensional margins will be much less
than those from the lower dimensional marginal this far out in the tails
of the distributions, so some higher dimensional marginals can be ignored.
Here are the covariance matrices and end points sent:
In[1]:= TT = {{1, 0.576363, 0.300013, 0.888477, 0.106961,
0.215919}, {0.576363, 1, 0.888477, 0.300013, 0.215919,
0.106961}, {0.300013, 0.888477, 1, -9.72249*10-6,
0.466809, -0.191847}, {0.888477, 0.300013, -9.72249*10-6,
1, -0.191847, 0.466809}, {0.106961, 0.215919, 0.466809,
-0.191847,
1, -0.862483}, {0.215919, 0.106961, -0.191847,
0.466809, -0.862483, 1}};
In[2]:= TTbnd = {7.14659, 7.14659, 7.83599, 7.83599, 5.55663, 5.55663};
In[3]:= TTp = {{0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 1, 0,
0}, {0,
0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {1, 0, 0, 0, 0,
0}}.TT.{{0,
0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 1, 0, 0},
{0, 0, 1,
0, 0, 0}, {0, 1, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}};
In[4]:= Tbnd = TTbnd.Transpose[{{0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0},
{0, 0,
0, 1, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {1,
0, 0,
0, 0, 0}}];
In[5]:= TTp2 = {{0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1,
0}, {0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0,
0}}.TT.Transpose[{{0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0},
{0, 0,
0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0}, {0,
1, 0,
0, 0, 0}}];
In[6]:= Tbnd2 = TTbnd.Transpose[{{0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0},
{0,
0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0},
{0, 1,
0, 0, 0, 0}}];
In[7]:= TTp3 = {{0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {1, 0, 0, 0, 0,
0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0,
1}}.TT.Transpose[{{0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0},
{1, 0,
0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {0,
0, 0,
0, 0, 1}}];
In[8]:= Tbnd3 = TTbnd.Transpose[{{0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0},
{1,
0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0},
{0, 0,
0, 0, 0, 1}}];
GDiff is a generalized differencing for higher dimensions:
In[9]:= GDiff[f_, {x_, a_, b_}, specs___] :=
GDiff[(f /. x -> a) - (f /. x -> b), specs]
In[10]:= GDiff[f_] := f
This defines the computation of 1-CDF incorporating marginal survival
functions:
In[11]:= Clear[OneMinusCDF];
In[12]:= OneMinusCDF[dist_, xvec_, cutoffdim_: 3] :=
Module[{res, len = Length[xvec], x, sf},
res = 1 -
GDiff[sf[Array[x, len]],
Apply[Sequence,
Thread[{Array[x, len], ConstantArray[-Infinity, len],
xvec}]]];
res = res /. sf[{(-Infinity) ..}] :> 1;
(* remove survival functions in more than 3 dimensions as
small *)
res = res /. {sf[arg_] /; len - Count[arg, -Infinity] >
cutoffdim :>
0};
res /. {sf[arg_] :>
SurvivalFunction[
MarginalDistribution[dist,
Cases[Transpose[{Range[len], arg}], {n_,
Except[-Infinity]} :>
n]], With[{y = DeleteCases[arg, -Infinity]},
If[Length[y] == 1, First[y], y]]]}
]
Using marginals up to dimension 3, we get consistent results for the
three cases:
In[13]:= OneMinusCDF[MultinormalDistribution[{0, 0, 0, 0, 0, 0}, TTp],
Tbnd, 3] // Timing
-8
Out[13]= {0.375, 2.75042 10 }
In[14]:= OneMinusCDF[MultinormalDistribution[{0, 0, 0, 0, 0, 0}, TTp2],
Tbnd2, 3] // Timing
-8
Out[14]= {0.36, 2.75042 10 }
In[15]:= OneMinusCDF[MultinormalDistribution[{0, 0, 0, 0, 0, 0}, TTp3],
Tbnd3, 3] // Timing
-8
Out[15]= {0.344, 2.75042 10 }
We are actually far enough out in the tails of the distribution that
using only 1D marginals gives the same result up to the number of digits
shown.
In[16]:= OneMinusCDF[MultinormalDistribution[{0, 0, 0, 0, 0, 0}, TTp],
Tbnd, 1] // Timing
-8
Out[16]= {0.015, 2.75042 10 }
There is some difference out beyond the digits shown:
In[17]:= OneMinusCDF[MultinormalDistribution[{0, 0, 0, 0, 0, 0}, TTp],
Tbnd, 3] - OneMinusCDF[MultinormalDistribution[{0, 0, 0, 0, 0, 0}, TTp],
Tbnd, 1]
-15
Out[17]= -2.2018 10
Darren Glosemeyer
Wolfram Research