The function MLE_dirichlet
performs a maximum-likelihood estimation of the
\(\alpha\) parameter of a Dirichlet distribution for a given sample of
probability vectors.
Value
Returns a numeric vector of length K=ncol(probs) representing the \(\alpha\) of the Dirichlet distribution.
Details
The density of the Dirichlet distribution for \(\alpha = (\alpha_1, ..., \alpha_K )\) and \(\alpha_i > 0 \forall i=1,...,K\) is given by $$f(p|\alpha)=\frac{1}{B(\alpha)} \prod_{i=1}{K} p_{i}^{\alpha_i - 1},$$ if \(0\leq p_i \leq 1 \forall i = 1,...,K\) and \(\sum_{i=1}^{K} p_i ) 1\), and \(f(p|\alpha) = 0\), else.
The function optimizes the log-likelihood of a sample of probability vectors
given in probs
using the function optim
and a Nelder-Mead
algorithm.