dens                 package:mclust                 R Documentation

_D_e_n_s_i_t_y _f_o_r _P_a_r_a_m_e_t_e_r_i_z_e_d _M_V_N _M_i_x_t_u_r_e_s

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

     Computes densities of observations in parameterized MVN mixtures.

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

     dens(modelName, data, logarithm = FALSE, parameters, warn=NULL, ...)

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

modelName: A character string indicating the model. The help file for
          'mclustModelNames' describes the available models. 

    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.  

logarithm: A logical value indicating whether or not the logarithm of
          the component  densities should be returned. The default is
          to return the component  densities, obtained from the log
          component densities by exponentiation. 

parameters: The parameters of the model:

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

    warn: A logical value indicating whether or not a warning should be
          issued when computations fail. The default is 'warn=FALSE'. 

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

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

     A numeric vector whose _i_th component is the density of the _ith_
     observation in 'data' in the MVN mixture specified  by
     'parameters'.

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

     'cdens', 'mclustOptions', 'do.call'

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

     faithfulBIC <- mclustBIC(faithful) 
     faithfulModel <- mclustModel(faithful, faithfulBIC) ## best parameter estimates
     names(faithfulModel)

     Dens <- dens(modelName = faithfulModel$modelName, data = faithful,
                     parameters = faithfulModel$parameters)
     Dens

     ## Not run: 
       ## alternative call
     oddDens <- do.call("dens", c(list(data = faithful), faithfulModel))  
     ## End(Not run)

