SimulateMixture          package:flowClust          R Documentation

_R_a_n_d_o_m _G_e_n_e_r_a_t_i_o_n _f_r_o_m _a _t _M_i_x_t_u_r_e _M_o_d_e_l

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

     This function can be used to generate a sample from a multivariate
     t mixture model.

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

     SimulateMixture(N, nu=4, mu, sigma, w)

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

       N: The number of observations.

      nu: The degrees of freedom used for the t distribution.

      mu: A matrix of size K x P, where K is the number of clusters and
          P is the dimension, containing the K mean vectors.

   sigma: An array of dimension K x P x P, containing the K covariance
          matrices.

       w: A vector of length K, containing the K cluster proportions.

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

     A matrix of size N x P.

_A_u_t_h_o_r(_s):

     Raphael Gottardo <raph@stat.ubc.ca>, Kenneth Lo <c.lo@stat.ubc.ca>

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

     'flowClust'

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

     ### Number of components
     K <- 5
     ### Dimension
     p <- 2
     ### Number of observations
     n <- 200
     Mu <- matrix(runif(K*p, 0, 20), K, p)
     Sigma <- array(0, c(K, p, p))

     for (k in 1:K)
     {
         Sigma[k,,][outer(1:p, 1:p, ">")] <- runif(p*(p-1)/2,-.1,.1)
         diag(Sigma[k,,]) <- runif(p,0,1)
         ### Make sigma positive definite
         Sigma[k,,] <- Sigma[k,,] %*% t(Sigma[k,,])
     }

     ### Generate the weights
     w <- rgamma(K,10,1)
     w <- w/sum(w)

     y <- SimulateMixture(n, nu=4, Mu, Sigma, w)

