Direct Elicitation in ND#
import preliz as pz
pz.style.use("preliz-doc")
Dirichlet mode#
dirichlet_mode returns a Dirichlet distribution where the marginals have the specified mode and mass and their masses
lie within the range mode ± bound.
The mode of a Dirichlet is defined as:
\[x_i = \frac{\alpha_i - 1}{\alpha_0 - K}, \qquad \alpha_i > 1\]
where \(K\) is the number of categories (the length of the vector \(\alpha\)), and \(\alpha_0 = \sum_{i=1}^K\alpha_i\)
ax, dist = pz.dirichlet_mode([1/3, 1/3, 1/3], bound=0.2)
When the dimension of the Dirichlet is 3 we can also plot the joint pdf
dist.plot_pdf(marginals=False);
ax, dist = pz.dirichlet_mode([0.2, 0.3, 0.5], bound=0.1)
dist.plot_pdf(marginals=False);