repnormmixEM            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 _N_o_r_m_a_l_s _w_i_t_h _R_e_p_e_a_t_e_d _M_e_a_s_u_r_e_m_e_n_t_s

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

     Returns EM algorithm output for mixtures of normals with repeated
     measurements and arbitrarily many components.

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

     repnormmixEM(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: An mxn matrix of data.  The columns correspond to the
          subjects and the rows correspond to the repeated
          measurements.

  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 k-vector of component means.  If NULL, then 'mu' is
          determined by a normal distribution 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 vector of standard deviations.  If NULL, then 1/'sigma'$^2$
          has random standard exponential entries according to a
          binning method done on the data. If 'lambda', 'mu', and
          'sigma' are NULL, then number of components is determined by
          'k'.

       k: Number of components.  Ignored unless all of 'lambda', 'mu', 
          and 'sigma' are 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:

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

       x: The raw data.

  lambda: The final mixing proportions.

      mu: The final mean parameters.

   sigma: The final standard deviations. If 'arbmean' = FALSE, then
          only the smallest standard deviation is returned. See 'scale'
          below.

   scale: If 'arbmean' = FALSE, then the scale factor for the component
          standard deviations is returned. Otherwise, this is omitted
          from the output.

  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:

     Hettmansperger, T. P. and Thomas, H.  (2000) Almost Nonparametric
     Inference for Repeated Measures in Mixture Models, _Journal of the
     Royals Statistical Society, Series B_ *62(4)* 811-825.

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

     'normalmixEM'

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

     ## EM output for the water-level task data set.

     data(Waterdata)
     water<-t(as.matrix(Waterdata))
     em.out<-repnormmixEM(water, k = 2, verb = TRUE, epsilon = 1e-03)
     em.out

