
gammamixEM(x, lambda = NULL, alpha = NULL, beta = NULL, k = 2, epsilon = 1e-08, maxit = 1000, maxrestarts=20, verb = FALSE)
NULL
,
then lambda
is random from a uniform Dirichlet
distribution (i.e., its entries are uniform random and then it is
normalized to sum to 1).k
is set to length(alpha)
. If NULL, then the initial value
is estimated by partitioning the data into k
regions (with lambda
determining
the proportion of values in each region) and then calculating the method of moments estimates.k
is set to length(beta)
. If NULL, then the initial value
is estimated the same method described for alpha
.alpha
and beta
are both NULL.gammamixEM
returns a list of class mixEM
with items:
alpha
and beta
.##Analyzing a 3-component mixture of gammas.
set.seed(100)
x <- c(rgamma(200, shape = 0.2, scale = 14), rgamma(200,
shape = 32, scale = 10), rgamma(200, shape = 5, scale = 6))
out <- gammamixEM(x, lambda = c(1, 1, 1)/3, verb = TRUE)
out[2:4]
Run the code above in your browser using DataLab