Fits a Dirichtlet Distribution to a dataset by maximum likelihood.
fitDirichlet(x,elog=mean(ult(x)),alpha0=rep(1,length(elog)),maxIter=20,n=nrow(x))
a dataset of compositions (acomp)
the expected log can provided instead of the dataset itself.
the start value for alpha parameter in the iteration
The maximum number of iterations in the Fischer scoring method.
the number of datapoints used to estimate elog
the estimated parameter
the likelihood
The dimension of the dataset minus the dimension of the parameter
Up to now the fitting can not handle missings.
The fitting is done using a modified version of the Fisher-Scoring method using analytiscal expressions for log mean and log variance. The modification is introducted to prevent the algorithm from leaving the admissible parameter set. It reduced the stepsize to at most have of distance to the limit of the admissible parameter set.
Aitchison, J. (1986) The Statistical Analysis of Compositional Data Monographs on Statistics and Applied Probability. Chapman & Hall Ltd., London (UK). 416p.
rDirichlet
, acompDirichletGOF.test
,
runif.acomp
, rnorm.acomp
,
# NOT RUN {
x <- rDirichlet.acomp(100,c(1,2,3,4))
fitDirichlet(x)
# }
Run the code above in your browser using DataLab