| Author |
Comment/Response |
nbrace
|
10/13/06 00:13am
I am trying to generate trivariate distribution values, using the commands below.
On the whole, the structure seems correct, and the covariance matrix I pass is valid (in the real world). However, in some cases Mathematica is unable to arrive at a value.
The error that appears states that the covariance matrix is not of a given form (involving variances and lambdas). In[6] 'corrects' this, however In[7] appears to disprove it, while In[8] is also in agreement. In fact, on the whole provided the (si sj li lj) value is greater than what is 'expected' (0.25 in the example below), a value can be determined.
My question is: why is there this restriction on the covariance matrix? and is there a way to 'get around' it?
Thank you,
N
In[1]:=
<<Statistics`MultinormalDistribution`
In[2]:=
rho3[r12_,r13_,r23_]:={{1,r12,r13},{r12,1,r23},{r13,r23,1}}
In[3]:=
L[a_,b_,c_,r12_,r13_,r23_]:=(r3=rho3[r12,r13,r23];ndist=
MultinormalDistribution[{0,0,0},r3];CDF[ndist,{a,b,c}])
In[4]:=
L[0,0,0,0,0,0]
Out[4]=
0.125
In[5]:=
L[0,0,0,0.5,0.5,0]
From In[5]:=
CDF::mnormfail: Unable to verify that sigma in MultinormalDistribution[mu, \
sigma] has a structure allowing computation of \
CDF[MultinormalDistribution[mu, sigma], x]. Currently, the structure of sigma \
is restricted to {{s1^2, s1 s2 l1 l2, s1 s3 l1 l3, ...}, {s2 s1 l2 l1, \
s2^2, s2 s3 l2 l3, ...}, {s3 s1 l3 l1, s3 s2 l3 l2, s3^2, ...}, \
...}, where Abs[li] <= 1, i = 1, 2, 3, ... .
Out[5]=
CDF[MultinormalDistribution[{0,0,0},{{1,0.5,0.5},{0.5,1,0},{0.5,0,1}}],{
0,0,0}]
In[6]:=
L[0,0,0,0.5,0.5,0.25]
Out[6]=
0.228441
In[7]:=
L[0,0,0,0.5,0.5,0.3]
Out[7]=
0.23258
In[8]:=
L[0,0,0,0.5,0.5,0.24999]
From In[8]:=
CDF::mnormsig: The parameter sigma in MultinormalDistribution[mu, sigma] does \
not have a structure allowing computation of CDF[MultinormalDistribution[mu, \
sigma], x]. Currently, the structure of sigma is restricted to {{s1^2, \
s1 s2 l1 l2, s1 s3 l1 l3, ...}, {s2 s1 l2 l1, s2^2, s2 s3 l2 l3, \
...}, {s3 s1 l3 l1, s3 s2 l3 l2, s3^2, ...}, ...}, where Abs[li] <= \
1, i = 1, 2, 3, ... .
Out[8]=
CDF[MultinormalDistribution[{0,0,0},{{1,0.5,0.5},{0.5,1,
0.24999},{0.5,0.24999,1}}],{0,0,0}]
URL: , |
|