simE                 package:mclust                 R Documentation

_S_i_m_u_l_a_t_e _f_r_o_m _a _P_a_r_a_m_e_t_e_r_i_z_e_d _M_V_N _M_i_x_t_u_r_e _M_o_d_e_l

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

     Simulate data from a parameterized MVN mixture model.

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

     simE(parameters, n, seed = NULL, ...)
     simV(parameters, n, seed = NULL, ...)
     simEII(parameters, n, seed = NULL, ...)
     simVII(parameters, n, seed = NULL, ...)
     simEEI(parameters, n, seed = NULL, ...)
     simVEI(parameters, n, seed = NULL, ...)
     simEVI(parameters, n, seed = NULL, ...)
     simVVI(parameters, n, seed = NULL, ...)
     simEEE(parameters, n, seed = NULL, ...)
     simEEV(parameters, n, seed = NULL, ...)
     simVEV(parameters, n, seed = NULL, ...)
     simVVV(parameters, n, seed = NULL, ...)

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

parameters: A list with the following components:

          _p_r_o A vector whose _k_th component is the mixing proportion
               for the _k_th component of the mixture model. If
               missing, equal proportions are assumed.

          _m_e_a_n The mean for each component. If there is more than one
               component, this is a matrix whose kth column is the mean
               of the _k_th component of the mixture model.

          _v_a_r_i_a_n_c_e A list of variance parameters for the model. The
               components of this list depend on the model
               specification. See the help file for 'mclustVariance'
               for details.

       n: An integer specifying the number of data points to be
          simulated. 

    seed: An optional integer argument to 'set.seed' for reproducible
          random class assignment. By default the current seed will be
          used. Reproducibility can also be achieved by calling
          'set.seed' before calling 'sim'. 

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

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

     This function can be used with an indirect or list call using
     'do.call', allowing the output of e.g. 'mstep', 'em' 'me',
     'Mclust', to be passed directly without the need to specify
     individual parameters as arguments.

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

     A matrix in which first column is the classification and the
     remaining columns are the 'n' observations simulated from the
     specified MVN  mixture model. 

             *  '"modelName"' A character string indicating the
                variance model used for the simulation.

_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:

     'sim', 'Mclust', 'mstepE', 'do.call'

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

     d <- 2
     G <- 2
     scale <- 1
     shape <- c(1, 9)

     O1 <- diag(2)
     O2 <- diag(2)[,c(2,1)]
     O <- array(cbind(O1,O2), c(2, 2, 2))
     O

     variance <- list(d= d, G = G, scale = scale, shape = shape, orientation = O)
     mu <- matrix(0, d, G) ## center at the origin
     simdat <- simEEV( n = 200, 
                       parameters = list(pro=c(1,1),mean=mu,variance=variance),
                       seed = NULL)

     cl <- simdat[,1]

     ## Not run: 
     sigma <- array(apply(O, 3, function(x,y) crossprod(x*y), 
                      y = sqrt(scale*shape)), c(2,2,2))
     paramList <- list(mu = mu, sigma = sigma)
     coordProj( simdat, paramList = paramList, classification = cl)
     ## End(Not run)

