Re: Serious problem with CDF[MultinormalDistribution...
- To: mathgroup at smc.vnet.net
- Subject: [mg113912] Re: Serious problem with CDF[MultinormalDistribution...
- From: Darren Glosemeyer <darreng at wolfram.com>
- Date: Thu, 18 Nov 2010 07:03:00 -0500 (EST)
On 11/17/2010 4:29 AM, Myeong Ae Kang wrote:
> Hello.
>
> I have a problem, serious and urgent.
>
> I got wrong results of CDF of MultinormalDistribution.
>
> I'm calculating (1.0 -CDF[MultinormalDistribution[{0, 0,0}, {{1, 0.559887,
> 0.289988}, {0.559887, 1,0.880157}, {0.289988, 0.880157, 1}}],
> {4.5,4.5,6.9958}]).
> The results is smaller than (1.0 -CDF[MultinormalDistribution[{0,0}, {{1,
> 0.559887}, {0.559887, 1}}], {4.5,4.5}]). It should be larger.
>
> Actually, I have to calculate more than 6 to 12 random variables (12 x 12 sigma
> matrix.).
>
> Mathematica 6.0 and 7.0.1 gave me the same wrong result.
>
> I compared this with the result of another system.
> That system gave the expected value.
>
> To fix this problem, what should I do?
>
>
> Regards,
> Myeong Ae Kang
>
>
>
This is addressed in version 8. Here are the results:
In[1]:= threeD = (1.0 -
CDF[MultinormalDistribution[{0, 0,
0}, {{1, 0.559887, 0.289988}, {0.559887, 1,
0.880157}, {0.289988, 0.880157, 1}}], {4.5, 4.5, 6.9958}])
-6
Out[1]= 6.75155 10
In[2]:= twoD = (1.0 -
CDF[MultinormalDistribution[{0,
0}, {{1, 0.559887}, {0.559887, 1}}], {4.5, 4.5}])
-6
Out[2]= 6.75155 10
In[3]:= threeD > twoD
Out[3]= True
The difference is at the level of machine precision numerical error:
In[4]:= threeD - twoD
-16
Out[4]= 1.11022 10
Note that if we artificially increase the precision as in the example
below, we get a difference at the same order of magnitude, so the
precision in the difference above is as good as could be expected (and
in fact probably better than should be expected) at machine precision.
In[5]:= CDF[MultinormalDistribution[{0, 0, 0},
Rationalize[{{1, 0.559887, 0.289988}, {0.559887, 1,
0.880157}, {0.289988, 0.880157, 1}}, 0]],
SetPrecision[{4.5, 4.5, 6.9958}, 50]]
Out[5]= 0.999993248446123977600817893853727681422304494350
In[6]:= CDF[MultinormalDistribution[{0, 0},
Rationalize[{{1, 0.559887}, {0.559887, 1}}, 0]],
SetPrecision[{4.5, 4.5}, 50]]
Out[6]= 0.999993248446124136306526964076086153533229885505
In[7]:= % - %%
-16
Out[7]= 1.5870570907022235847211092539116 10
Darren Glosemeyer
Wolfram Research