mclustDAtrain             package:mclust             R Documentation

_M_c_l_u_s_t_D_A _T_r_a_i_n_i_n_g

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

     Training phase for MclustDA discriminant analysis.

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

     mclustDAtrain(data, labels, G, emModelNames, eps, tol, itmax, 
                   equalPro, warnSingular, verbose)

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

    data: A numeric vector, matrix, or data frame of observations.
          Categorical variables are not allowed. If a matrix or data
          frame, rows correspond to observations and columns correspond
          to variables.  

  labels: A numeric or character vector assigning a class label to each
          observation. 

       G: An integer vector specifying the numbers of Gaussian mixture
          components (clusters) for which the BIC is to be calculated
          (the same specification is used for all classes). Default:
          _1:9_. 

emModelNames: A vector of character strings indicating the models to be
          fitted  in the EM phase of clustering. Possible models: 
           "E" for spherical, equal variance (one-dimensional)
            "V" for spherical, variable variance (one-dimensional)
            "EII": spherical, equal volume 
           "VII": spherical, unequal volume 
           "EEI": diagonal, equal volume, equal shape 
           "VEI": diagonal, varying volume, equal shape 
           "EVI": diagonal, equal volume, varying shape 
           "VVI": diagonal, varying volume, varying shape 
           "EEE": ellipsoidal, equal volume, shape, and orientation 
           "EEV": ellipsoidal, equal volume and equal shape
           "VEV": ellipsoidal, equal shape 
           "VVV": ellipsoidal, varying volume, shape, and orientation 

           The default is '.Mclust\$emModelNames'. 

     eps: A scalar tolerance for deciding when to terminate
          computations due to computational singularity in covariances.
          Smaller values of 'eps' allow computations to proceed nearer
          to singularity. The default is '.Mclust\$eps'.  

     tol: A scalar tolerance for relative convergence of the
          loglikelihood. The default is '.Mclust\$tol'. 

   itmax: An integer limit on the number of EM iterations. The default
          is '.Mclust\$itmax'. 

equalPro: Logical variable indicating whether or not the mixing
          proportions are equal in the model. The default is
          '.Mclust\$equalPro'. 

warnSingular: A logical value indicating whether or not a warning
          should be issued whenever a singularity is encountered. The
          default is 'warnSingular=FALSE'. 

 verbose: A logical value indicating whether or not to print the models
          and numbers of components for each class.
          Default:'verbose=TRUE'. 

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

     A list in which each element gives the optimal parameters for the
     model best fitting each class according to BIC.

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

     C. Fraley and A. E. Raftery (2002a). Model-based clustering,
     discriminant analysis, and density estimation. _Journal of the
     American Statistical Association 97:611-631_.  See <URL:
     http://www.stat.washington.edu/mclust>. 

     C. Fraley and A. E. Raftery (2002b). MCLUST:Software for
     model-based clustering, density estimation and discriminant
     analysis.  Technical Report, Department of Statistics, University
     of Washington.  See <URL: http://www.stat.washington.edu/mclust>.

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

     'summary.mclustDAtrain',  'mclustDAtest',  'EMclust',  'hc',
     'mclustOptions'

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

     n <- 250 ## create artificial data
     set.seed(0)
     par(pty = "s")
     x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)),
                matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1])
     xclass <- c(rep(1,n),rep(2,n))
     ## Not run: 
     mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE)
     ## End(Not run)

     odd <- seq(1, 2*n, 2)
     train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step
     summary(train)

     even <- odd + 1
     test <- mclustDAtest(x[even, ], train) ## compute model densities
     clEven <- summary(test)$class ## classify training set
     compareClass(clEven,xclass[even])

