MLE_dirichlet: Estimate the parameter of a Dirichlet distribution
Description
The function MLE_dirichlet performs a maximum-likelihood estimation of the
\(\alpha\) parameter of a Dirichlet distribution for a given sample of
probability vectors.
Returns a numeric vector of length K=ncol(probs) representing the
\(\alpha\) of the Dirichlet distribution.
Arguments
probs
a matrix with N rows representing observations of probability
vectors and K columns representing the classes. Therefore, values of each row
should sum to 1.
alpha0
vector of K=ncol(probs) values as starting parameter for the optimization.
Values have to be greater 0.
Author
Sebastian Hellmann.
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.