Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5445 > unrolled thread
| Started by | Todd <johnson.todd.r@gmail.com> |
|---|---|
| First post | 2011-10-06 08:37 +0000 |
| Last post | 2011-10-07 09:04 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Extra parameter for DirichletDistribution Todd <johnson.todd.r@gmail.com> - 2011-10-06 08:37 +0000
Re: Extra parameter for DirichletDistribution sashap <pavlyk@gmail.com> - 2011-10-07 09:04 +0000
| From | Todd <johnson.todd.r@gmail.com> |
|---|---|
| Date | 2011-10-06 08:37 +0000 |
| Subject | Extra parameter for DirichletDistribution |
| Message-ID | <j6jpbm$mdk$1@smc.vnet.net> |
Can anyone tell me why DirichletDistribution in Mathematica 8 requires
k+1 parameters for a k-dimensional distribution and why the extra
parameter cannot be 0, which would give results similar to other
software packages that require only k parameters. The function of the
extra parameter is clear from the mean of the 2D distribution given in
the help file:
Namely, the mean of DirichletDistribution[a1, a2, a3] is {a1/
(a1+a2+a3), {a2/(a1+a2+a3)}.
In this case, setting a3 to 0 would give me the desired result, but
the function requires a3 to be positive.
I noticed that a definition of DirichletDistribution from an older
Wolfram tutorial required only k parameters for a k-dimensional
distribution.
Todd
[toc] | [next] | [standalone]
| From | sashap <pavlyk@gmail.com> |
|---|---|
| Date | 2011-10-07 09:04 +0000 |
| Message-ID | <j6mfa9$7jh$1@smc.vnet.net> |
| In reply to | #5445 |
Dirichet distribution with (K+1) parameters is a distribution on a symplex
which has dimension K. See
http://en.wikipedia.org/wiki/Dirichlet_distribution
In other words, in Mathematica, vector {x[1], x[2], ..., x[k]} \
[Distributed]
DirichletDistribution[{a[1],a[2],...,a[k],a[k+1]}] contains
independent
variables only.
One occasionally sees reference to Dirichlet vector as having k+1
elements,
subject to constraint x[1]+x[2]+...+x[k]+x[k+1] == 1
To reconstruct such a distribution in Mathematica 8, for K=2, we would
write:
TransformedDistribution[ {x, y, 1-x-y}, {x,y} \[Distributed]
DirichletDistribution[{a1,a2,a3}] ]
Notice, that parameters a1, a2, a3 need to be strictly positive for
the distribution to be defined.
Also notice, that the distribution so constructed is degenerate in 3D,
because its probability is concentrated
on the lower-dimensional subspace, but you can use it to compute
expectations:
In[179]:= Mean[
TransformedDistribution[{x, y, 1 - x - y}, {x, y} \[Distributed]
DirichletDistribution[{a1, a2, a3}]]]
Out[179]= {a1/(a1 + a2 + a3), a2/(a1 + a2 + a3), a3/(a1 + a2 + a3)}
In[180]:= Probability[
x < y < z, {x, y, z} \[Distributed]
TransformedDistribution[{x, y, 1 - x - y}, {x, y} \[Distributed]
DirichletDistribution[{1, 2, 3}]]]
Out[180]= 67/144
In[182]:= RandomVariate[
TransformedDistribution[{x, y, 1 - x - y}, {x, y} \[Distributed]
DirichletDistribution[{1, 2, 3}]], 2]
Out[182]= {{0.0222922, 0.40553, 0.572177}, {0.0958752, 0.541714,
0.362411}}
and so on.
Hope this helps.
On Oct 6, 3:37 am, Todd <johnson.tod...@gmail.com> wrote:
> Can anyone tell me why DirichletDistribution in Mathematica 8 requires
> k+1 parameters for a k-dimensional distribution and why the extra
> parameter cannot be 0, which would give results similar to other
> software packages that require only k parameters. The function of the
> extra parameter is clear from the mean of the 2D distribution given in
> the help file:
>
> Namely, the mean of DirichletDistribution[a1, a2, a3] is {a1/
> (a1+a2+a3), {a2/(a1+a2+a3)}.
>
> In this case, setting a3 to 0 would give me the desired result, but
> the function requires a3 to be positive.
>
> I noticed that a definition of DirichletDistribution from an older
> Wolfram tutorial required only k parameters for a k-dimensional
> distribution.
>
> Todd
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web