MarginalDistribution[DirichletDistribution[{a, b, c, d}], #] & /@ Range@4

{BetaDistribution[a, b + c + d], BetaDistribution[b, a + c + d],
BetaDistribution[c, a + b + d],
MarginalDistribution[DirichletDistribution[{a, b, c, d}], 4]}

The marginal of d is clearly BetaDistribution[d, a + b + c], unless I'm having a brain spasm. Why does Mathematica not output this?

  • $\begingroup$ I don't know. Might it have to do with the fact that the DirichletDistribution has k+1 shape parameters but only k dimensions? $\endgroup$ Jul 10 '15 at 9:57
  • 6
    $\begingroup$ As a follow up to the previous comment: With four arguments, the PDF of a DirichletDistribution is a three dimensional function, so it can have only three marginals. $\endgroup$ Jul 10 '15 at 10:46
  • $\begingroup$ @SjoerdC.deVries: Well, unless I'm misinterpreting what you're getting at, that's just plain wrong w/r to number of marginals: any of the concentrations can be marginalized out, giving* four* possible simple marginal distributions, and of course any combination of concentrations can be marginalized. I guess it comes down to how MMA defines the arguments of the MarginalDistribution function, which I find unsatisfying in this case: I have to manually create the MD for the Kth paramter. $\endgroup$
    – ciao
    Jul 10 '15 at 22:28
  • $\begingroup$ I'm decidedly not an expert in this area, but reading MMA's documentation and other sources like Wikipedia it really looks like that the number of independent dimensions is one less than the number of alphas. Do you at least agree that the number of marginals should be equal to the number of dimensions of the PDF? $\endgroup$ Jul 11 '15 at 21:21
  • 1
    $\begingroup$ I saw that definition but it did not help me as it describes a single marginal and does not tell how many there are. Also, the PDF on the same page clearly has k-1 random variables. Given that the marginal of a PDF is usually defined in terms of integrating away the other variables it is then understandable that there are only k-1 in mma. HOWEVER, given the k dimensional embedding, and the fact that the dependency of the kth variable on all the others holds for any of the others I fully agree with you that there should be four marginals in this case. The Dirichlet distribution is weird... $\endgroup$ Jul 12 '15 at 7:56

It is a matter of definition, of course. Mathematica defines DirichletDistribution[{a1, a2, a3, a4}] to be a 3D distribution, compatible with 3D Lebesgue measure.

The definition you have in mind is

DirichletDistribution2[avec_List] := 
 Block[{x, n = Length[avec] - 1}, 
  TransformedDistribution[Append[Array[x, n], 1 - Total[Array[x, n]]],
    Distributed[Array[x, n], DirichletDistribution[avec]]]]

That is

In[249]:= DirichletDistribution2[{a, b, c, d}]

Out[249]= TransformedDistribution[{x1, x2, x3, 1 - x1 - x2 - x3}, 
      {x1, x2, 3} ~Distributed~ DirichletDistribution[{a, b, c, d}]]

The marginal distribution then works as you would expect, however the transformed distribution does not recognize the 4-th marginal as a beta distribution out of the box:

In[242]:= Table[
 MarginalDistribution[DirichletDistribution2[{a, b, c, d}], k], {k, 4}]

Out[242]= {BetaDistribution[a, b + c + d], 
 BetaDistribution[b, a + c + d], BetaDistribution[c, a + b + d], 
  1 - x1 - x2 - x3, {x1, x2, x3} ~Distributed~
   DirichletDistribution[{a, b, c, d}]]}

This can be determined by a method of moments, for example:

m4moments = 
     1 - x1 - x2 - x3, {x1, x2, x3} \[Distributed] 
      DirichletDistribution[{a, b, c, d}]], r], {r, 4}];

betamoments = Table[Moment[BetaDistribution[alpha, beta], r], {r, 4}];

In[259]:= Solve[
 FunctionExpand[m4moments] == FunctionExpand[betamoments], {alpha, 

Out[259]= {{alpha -> d, beta -> a + b + c}}
  • $\begingroup$ That's a nice post, +1 $\endgroup$
    – ciao
    Jul 13 '15 at 22:47

As was noted by Sjoerd C. de Vries in the comments, DirichletDistribution[{a, b, c, d}] is a three-dimensional distribution:

DistributionDomain@DirichletDistribution[{a, b, c, d}]

(* {Interval[{0, 1}], Interval[{0, 1}], Interval[{0, 1}]} *)

and therefore asking for the fourth marginal isn't defined.

  • $\begingroup$ Hi Stefan, could you please comment on the above comments? $\endgroup$ Jul 12 '15 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.