mclustDAtest             package:mclust             R Documentation

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

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

     Testing phase for MclustDA discriminant analysis.

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

     mclustDAtest(data, models)

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

    data: A numeric vector, matrix, or data frame of observations to be
          classified. 

  models: A list of MCLUST-style models including parameters, usually
          the result of applying 'mclustDAtrain' to some training data.            

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

     A matrix in which the '[i,j]'th entry is the  density for that
     test observation _i_ in the model for class _j_.

_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.mclustDAtest', 'mclustDAtrain'

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

     n <- 250 ## create artificial data
     set.seed(0)
     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: 
     par(pty = "s")
     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
     summary(test)$class ## classify training set

