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=NULL, modelNames=NULL, prior=NULL, 
                   control=emControl(), initialization=NULL, warn=FALSE, 
                   verbose=TRUE, ...)

_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 mixture
          components (clusters) for which the BIC is to be calculated. 
          The default is 'G=1:9'.  

modelNames: A vector of character strings indicating the models to be
          fitted  in the EM phase of clustering. The help file for
          'mclustModelNames' describes the available models. The
          default is 'c("E", "V")' for univariate data and
          'mclustOptions()\$emModelNames' for multivariate data. 

   prior: The default assumes no prior, but this argument allows
          specification of a  conjugate prior on the means and
          variances through the function  'priorControl'. 

 control: A list of control parameters for EM. The defaults are set by
          the call 'emControl()'.  

initialization: A list containing zero or more of the following
          components:

        _h_c_P_a_i_r_s A matrix of merge pairs for hierarchical clustering
             such as produced by function 'hc'. The default is to
             compute a hierarchical clustering tree by applying
             function 'hc' with 'modelName = "E"' to univariate data
             and 'modelName = "VVV"' to multivariate data or a subset
             as indicated by the 'subset' argument.  The hierarchical
             clustering results are used as starting values for EM.  

        _s_u_b_s_e_t A logical or numeric vector specifying a subset of the
             data to be used in the initial hierarchical clustering
             phase.

    warn: A logical value indicating whether or not certain warnings
          (usually related to singularity) should be issued when
          estimation fails. The default is to suppress these warnings. 

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

    ... : Catches unused arguments in indirect or list calls via
          'do.call'. 

_D_e_t_a_i_l_s:

     Except for 'labels' and 'verbose', the arguments are the same as
     those for 'mclustBIC'.

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

     A list in which each element gives the parameters and other
     summary information for the model best fitting each class
     according to BIC. Attributes are the input parameters other than
     'data', 'labels' and 'verbose'.

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

     C. Fraley and A. E. Raftery (2002). Model-based clustering,
     discriminant analysis, and density estimation. _Journal of the
     American Statistical Association 97:611-631_. 

     C. Fraley and A. E. Raftery (2006). MCLUST Version 3 for R: Normal
     Mixture Modeling and Model-Based Clustering,  Technical Report no.
     504, Department of Statistics, University of Washington.

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

     'summary.mclustDAtrain',  'mclustDAtest',  'mclustBIC'

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

     odd <- seq(1, nrow(cross), by = 2)
     train <- mclustDAtrain(cross[odd,-1], labels = cross[odd,1]) ## training step
     summary(train)

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

