fit_dirichlet: Fit Dirichlet parameters

Description Usage Arguments Value Examples

Description

Fit Dirichlet parameters

Usage

1
2
3
fit.dirichlet(X, type = "mm")

fit.genDirichlet(X, type = "mm")

Arguments

X

samples from a dirichlet distribution

type

mm for Method of Moments estimation or ml for Maximum Likelihood estimation.

Value

A list giving the k value or vector of k values for the Generalized Dirichlet and vector of p estimates. The normal Dirichlet parameterization can be obtained by k*p. The fit.dirichlet function returns two estimates of k. One based on the most likely parameter in the distribution, the other based on a weighted mean of the k estimates for each parameter.

Examples

1
2
3
4
5
6
fit.dirichlet(matrix(c(.1, .9, .2, .8, .3, .7), nrow=3, ncol=2, byrow=TRUE), type="mm")
Z <- rdirichlet(100, c(4,3,2))
fit.dirichlet(Z)
fit.dirichlet(Z, "ml")
  Z2 <- rGenDirichlet(100, c(0.7, 0.2, 0.1), c(10, 20, 20))
  fit.genDirichlet(Z2)

bertcarnell/dirichlet documentation built on May 12, 2021, 11:55 p.m.