mvnormalmixEM            package:mixtools            R Documentation

_E_M _A_l_g_o_r_i_t_h_m _f_o_r _M_i_x_t_u_r_e_s _o_f _M_u_l_t_i_v_a_r_i_a_t_e _N_o_r_m_a_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     Return EM algorithm output for mixtures of multivariate normal
     distributions.

_U_s_a_g_e:

     mvnormalmixEM(x, lambda = NULL, mu = NULL, sigma = NULL, k = 2,
                   arbmean = TRUE, arbvar = TRUE, epsilon = 1e-08, 
                   maxit = 10000, verb = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: A matrix of size nxp consisting of the data.

  lambda: Initial value of mixing proportions.  Entries should sum to
          1.  This determines number of components.  If NULL, then
          'lambda' is random from uniform Dirichlet and number of
          components is determined by 'mu'.

      mu: A list of size k consisting of initial values for the
          p-vector mean parameters.   If NULL, then the vectors are
          generated from a normal distribution with mean and standard
          deviation according to a binning method done on the data. If
          both 'lambda' and 'mu' are NULL, then number of components is
          determined by 'sigma'.

   sigma: A list of size k consisting of initial values for the pxp
          variance-covariance matrices.   If NULL, then 'sigma' is
          generated using the data.   If 'lambda', 'mu', and 'sigma'
          are NULL, then number of components is determined by 'k'.

       k: Number of components.  Ignored unless 'lambda', 'mu', and
          'sigma' are all NULL.

 arbmean: If TRUE, then the component densities are allowed to have
          different 'mu's. If FALSE, then a scale mixture will be fit.

  arbvar: If TRUE, then the component densities are allowed to have
          different 'sigma's. If FALSE, then a location mixture will be
          fit.

 epsilon: The convergence criterion.

   maxit: The maximum number of iterations.

    verb: If TRUE, then various updates are printed during each
          iteration of the algorithm.

_V_a_l_u_e:

     'normalmixEM' returns a list of class 'mixEM' with items: 

       x: The raw data.

  lambda: The final mixing proportions.

      mu: A list of with the final mean vectors.

   sigma: A list with the final variance-covariance matrices.

  loglik: The final log-likelihood.

posterior: An nxk matrix of posterior probabilities for observations.

all.loglik: A vector of each iteration's log-likelihood.

restarts: The number of times the algorithm restarted due to
          unacceptable choice of initial values.

      ft: A character vector giving the name of the function.

_R_e_f_e_r_e_n_c_e_s:

     McLachlan, G. J. and Peel, D. (2000) _Finite Mixture Models_, John
     Wiley & Sons, Inc.

_S_e_e _A_l_s_o:

     'normalmixEM'

_E_x_a_m_p_l_e_s:

     ##Fitting randomly generated data with a 2-component location mixture of bivariate normals.

     x.1<-rmvnorm(40, c(0, 0))
     x.2<-rmvnorm(60, c(3, 4))
     X.1<-rbind(x.1, x.2)
     mu<-list(c(0, 0), c(3, 4))

     out.1<-mvnormalmixEM(X.1, arbvar = FALSE, mu = mu,
                          epsilon = 1e-02)
     out.1[2:5]

     ##Fitting randomly generated data with a 2-component scale mixture of bivariate normals.

     x.3<-rmvnorm(40, c(0, 0), sigma = 
                  matrix(c(200, 1, 1, 150), 2, 2))
     x.4<-rmvnorm(60, c(0, 0))
     X.2<-rbind(x.3, x.4)
     lambda<-c(0.40, 0.60)
     sigma<-list(diag(1, 2), matrix(c(200, 1, 1, 150), 2, 2))

     out.2<-mvnormalmixEM(X.2, arbmean = FALSE,
                          sigma = sigma, lambda = lambda,
                          epsilon = 1e-02)
     out.2[2:5]

