Re: Multinormal CDF and Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg14637] Re: Multinormal CDF and Mathematica
- From: Brian Boonstra <boonstb at cmg.FCNBD.COM>
- Date: Wed, 4 Nov 1998 13:47:05 -0500
- References: <v04020a04b264a47c90f8@[24.192.58.10]>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Colin Good grief! You are perfectly right, of course. I just assumed the identity matrix case (which I was actually just using to test my understanding of the syntax) would work the same as the general case. Testing with a nontrivial covariance matrix shows that the CDF[] implementation works just fine. Thanks for your reply - it was a big help! Best Regards, Brian > > Has anyone got a fix for the (apparent) bug in the standard stats > > package that keeps the CDF of the multivariate normal distribution from > > being computed in 3 and more dimensions? I find the following: > > In[1]:= <<Statistics`MultinormalDistribution` > > In[2]:= CDF[MultinormalDistribution[{0,0},IdentityMatrix[2]],{0,0}] > > Out[2]= 0.25 > > In[3]:= CDF[MultinormalDistribution[{0,0,0},IdentityMatrix[3]],{0,0,0}] > > Solve::svars: > > Equations may not give solutions for all "solve" variables. > > > The CDF function in the Multinormal package does not work > if any of the correlation coefficients is zero, > irrespective of whether the 0 is a symbolic zero (0) or > a numerical zero (0.). Since your variance-covariance > matrix is an identity matrix, it doesn't work in your > case. > > Fortunately, a FIX is easy: > > In the case of zero correlation (your scenario), the > CDF has an easy symbolic form. For the general > m-dimensional case: > > CDF(xvec) = (1/2)^m (1+Erf[x1/Sqrt[2]) *...* > (1+Erf[xm/Sqrt[2]) > > where xvec = {x1, x2, ..., xm} > > Cheerio > > Colin > > Colin Rose tr(I) - Theoretical Research Institute