Basic Examples (3)
Basic Examples
(3)
Condition a 2D symbolic multivariate normal distribution on the value of the second coordinate:
In[32]:=
dist=MultinormalDistribution[{μ1,μ2},{{Σ11,Σ12},{Σ12,Σ22}}];[dist,2x2]
Out[33]=
MultinormalDistributionμ1+,Σ11-
(x2-μ2)Σ12
Σ22
2
Σ12
Σ22
A is returned if you specify that the first marginal should be computed:
In[34]:=
Out[34]=
NormalDistributionμ1+,
(x2-μ2)Σ12
Σ22
Σ11-
2
Σ12
Σ22
———
Generate a random :
In[35]:=
randomDist=With[{dim=10},MultinormalDistribution[RandomReal[{-10,10},dim],RandomVariate[InverseWishartMatrixDistribution[dim+1,IdentityMatrix[dim]]]]];
Calculate how the expected value of the second coordinate depends on the value of the first:
In[119]:=
Simplify@Mean@[randomDist,1x.[1],2]
Out[119]=
7.51081+0.680301x.[1]
Calculate the derivative:
In[120]:=
D[%,x.[1]]
Out[120]=
0.680301
———
Condition on multiple indices and obtain the means of multiple marginals:
In[121]:=
Simplify@Mean@[randomDist,{1x.[1],2x.[2]},{3,4}]
Out[121]=
{-21.2991+0.694197x.[1]+1.55379x.[2],18.4973-0.110858x.[1]-1.49777x.[2]}
Applications (3)
Applications
(3)
Properties and Relations (2)
Properties and Relations
(2)