EMnormal function

Parameter Estimation of Normal Mixture Using EM Algorithm

Parameter Estimation of Normal Mixture Using EM Algorithm

EMnormal' is used to estimate the parameters of a univariate or multivariate normal mixture model using the expectation-maximization (EM) algorithm. The result can be used as the initial value for the mixLogconcandmixLogconcHD` function.

EMnormal(x, C = 2, nstart = 20, tol = 1e-05)

Arguments

  • x: an n by p data matrix where n is the number of observations and p is the dimension of the data.
  • C: number of mixture components. Default is 2.
  • nstart: number of initializations to try. Default is 20.
  • tol: stopping criteria (threshold value) for the EM algorithm. Default is 1e-05.

Returns

A list containing the following elements: - loglik: final log-likelihood.

  • pi: estimated mixing proportions.

  • mu: estimated component means.

  • sigma: estimated component standard deviation or covariance matrix.

Examples

#-----------------------------------------------------------------------------------------# # Univariate Case #-----------------------------------------------------------------------------------------# x = matrix(rnorm(100, 2, sqrt(2)), nrow = 100) x[1:60] = x[1:60] + 5 ini = EMnormal(x)

See Also

mixLogconc, mixLogconcHD

  • Maintainer: Suyeon Kang
  • License: GPL (>= 2)
  • Last published: 2023-09-20

Useful links