New in Wolfram
Mathematica
8: Nonparametric, Derived, and Formula Distributions
◄
previous

next
►
Core Algorithms
Create a Hierarchical Parameter Mixture Model
A hierarchical model created with
ParameterMixtureDistribution
. This model has two levels. The first is a normal distribution with mean
and variance
. At the second level,
has a chisquare distribution with
degrees of freedom.
In[1]:=
X
\[ScriptCapitalD] = ParameterMixtureDistribution[ NormalDistribution[\[Mu], \[Sigma]], \[Sigma] \[Distributed] ChiSquareDistribution[\[Lambda]]];
In[2]:=
X
pdf[\[Lambda]_, \[Mu]_, x_] = PDF[\[ScriptCapitalD], x]
Out[2]=
In[3]:=
X
Plot[Evaluate@ Table[pdf[\[Lambda], 0, x], {\[Lambda], Range[2.1, 5, .5]}], {x, 5, 5}, PlotRange > All, Filling > Table[i > {i  1}, {i, 2, Length[Range[2.1, 5, .5]]}]]
Out[3]=