Learn R Programming

fpc (version 2.2-13)

mergeparameters: New parameters from merging two Gaussian mixture components

Description

Re-computes pointwise posterior probabilities, mean and covariance matrix for a mixture component obtained by merging two mixture components in a Gaussian mixture.

Usage

mergeparameters(xdata, j1, j2, probs, muarray,Sigmaarray, z)

Value

List with components

probs

see above; sum of probabilities for original components j1 and j2 is now probs[j1]. Note that generally, also for the further components, values for the merged component are in place j1 and values in place j2 are not changed. This means that in order to have only the information for the new mixture after merging, the entries in places j2 need to be suppressed.

muarray

see above; weighted mean of means of component j1 and j2 is now in place j1.

Sigmaarray

see above; weighted covariance matrix handled as above.

z

see above; original entries for columns j1 and j2 are summed up and now in column j1.

Arguments

xdata

data (something that can be coerced into a matrix).

j1

integer. Number of first mixture component to be merged.

j2

integer. Number of second mixture component to be merged.

probs

vector of component proportions (for all components; should sum up to one).

muarray

matrix of component means (rows).

Sigmaarray

array of component covariance matrices (third dimension refers to component number).

z

matrix of observation- (row-)wise posterior probabilities of belonging to the components (columns).

References

Hennig, C. (2010) Methods for merging Gaussian mixture components, Advances in Data Analysis and Classification, 4, 3-34.

Examples

Run this code
  options(digits=3)
  set.seed(98765)
  require(mclust)
  iriss <- iris[sample(150,20),-5]
  irisBIC <- mclustBIC(iriss)
  siris <- summary(irisBIC,iriss)
  probs <- siris$parameters$pro
  muarray <- siris$parameters$mean
  Sigmaarray <- siris$parameters$variance$sigma
  z <- siris$z
  mpi <- mergeparameters(iriss,1,2,probs,muarray,Sigmaarray,z)
  mpi$probs
  mpi$muarray

Run the code above in your browser using DataLab