Learn R Programming

sirt (version 0.31-20)

dirichlet.mle: Maximum Likelihood Estimation of the Dirichlet Distribution

Description

Maximum likelihood estimation of the parameters of the Dirichlet distribution

Usage

dirichlet.mle(x, eps = 10^(-16), convcrit = 1e-05 , maxit=1000, progress=FALSE)

Arguments

x
Data frame with $N$ observations and $K$ variables of a Dirichlet distribution
eps
Tolerance number which is added to prevent from logarithms of zero
convcrit
Convergence criterion
maxit
Maximum number of iterations
progress
Display iteration progress?

Value

  • A list with following entries
  • alphaVector of $\alpha$ parameters
  • alpha0The concentration parameter $\alpha_0 = \sum_k \alpha_k$
  • xsiVector of proportions $\xi_k = \alpha_k / \alpha_0$

References

Minka, T. P. (2012). Estimating a Dirichlet distribution. Technical Report.

See Also

For simulating Dirichlet vectors with matrixwise $\bold{\alpha}$ parameters see dirichlet.simul.

Examples

Run this code
# (1) simulate data
set.seed(789)
N <- 200
probs <- c(.5 , .3 , .2 )
alpha0 <- .5
alpha <- alpha0*probs
alpha <- matrix( alpha , nrow=N , ncol=length(alpha) , byrow=TRUE  )
x <- dirichlet.simul( alpha )

# (2) estimate Dirichlet parameters
dirichlet.mle(x)
##   $alpha
##   [1] 0.24507708 0.14470944 0.09590745
##   $alpha0
##   [1] 0.485694
##   $xsi
##   [1] 0.5045916 0.2979437 0.1974648

Run the code above in your browser using DataLab