View source: R/compare_alphas.R
compare_alphas | R Documentation |
This function provides a graphical display to investigate the impact of concentration parameter values in the Dirichlet distribution.
compare_alphas(n, alpha)
n |
number of weights which is generated from Dirichlet distribution |
alpha |
concentration parameter is given in vector form; each element represents each group. |
We assumed that the concentration parameters are identical in all weights, it means that \boldsymbol{\alpha} =[\alpha, \alpha, \cdots \alpha]
. The probability mass
function of the weights is given by:
\displaystyle{f(w_1,w_2, \cdots w_n;\boldsymbol{\alpha} )=\frac{\displaystyle{\Gamma(n\alpha)}} {{\Gamma(\alpha)}^n} \prod_{i=1}^{n}{w_i^{\alpha-1}}}
where \boldsymbol{\alpha} =[\alpha, \alpha, \cdots \alpha]
is the vector of concentration parameter, and w_i
is the stochastic weights which sum to one.
graphical display of different concentration parameters of Dirichlet distribution
n <- 10000
alpha <- c(5,10,20)
compare_alphas(n,alpha)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.