mclustBIC: BIC for Model-Based Clustering

Description Usage Arguments Value References See Also Examples

View source: R/mclust.R

Description

BIC for parameterized Gaussian mixture models fitted by EM algorithm initialized by model-based hierarchical clustering.

Usage

1
2
3
4
5
6
7
8
mclustBIC(data, G = NULL, modelNames = NULL, 
          prior = NULL, control = emControl(), 
          initialization = list(hcPairs = NULL, 
                                subset = NULL, 
                                noise = NULL), 
          Vinv = NULL, warn = mclust.options("warn"), 
          x = NULL, verbose = interactive(), 
          ...)

Arguments

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.

G

An integer vector specifying the numbers of mixture components (clusters) for which the BIC is to be calculated. The default is G=1:9, unless the argument x is specified, in which case the default is taken from the values associated with x.

modelNames

A vector of character strings indicating the models to be fitted in the EM phase of clustering. The help file for mclustModelNames describes the available models. The default is:

c("E", "V")

for univariate data

mclust.options("emModelNames")

for multivariate data (n > d)

c("EII", "VII", "EEI", "EVI", "VEI", "VVI")

the spherical and diagonal models for multivariate data (n <= d)

unless the argument x is specified, in which case the default is taken from the values associated with x.

prior

The default assumes no prior, but this argument allows specification of a conjugate prior on the means and variances through the function priorControl.

control

A list of control parameters for EM. The defaults are set by the call emControl().

initialization

A list containing zero or more of the following components:

hcPairs

A matrix of merge pairs for hierarchical clustering such as produced by function hc. For multivariate data, the default is to compute a hierarchical clustering tree by applying function hc with modelName = "VVV" to the data or a subset as indicated by the subset argument. The hierarchical clustering results are to start EM. For univariate data, the default is to use quantiles to start EM.

subset

A logical or numeric vector specifying a subset of the data to be used in the initial hierarchical clustering phase. By default no subset is used unless the number of observations exceeds the value specified by mclust.options("subset"). Note that to guarantee exact reproducibility of results a seed must be specified (see set.seed).

noise

A logical or numeric vector indicating an initial guess as to which observations are noise in the data. If numeric the entries should correspond to row indexes of the data. If supplied, a noise term will be added to the model in the estimation.

Vinv

An estimate of the reciprocal hypervolume of the data region. The default is determined by applying function hypvol to the data. Used only if an initial guess as to which observations are noise is supplied.

warn

A logical value indicating whether or not certain warnings (usually related to singularity) should be issued when estimation fails. The default is controlled by mclust.options.

x

An object of class 'mclustBIC'. If supplied, mclustBIC will use the settings in x to produce another object of class 'mclustBIC', but with G and modelNames as specified in the arguments. Models that have already been computed in x are not recomputed. All arguments to mclustBIC except data, G and modelName are ignored and their values are set as specified in the attributes of x. Defaults for G and modelNames are taken from x.

verbose

A logical controlling if a text progress bar is displayed during the fitting procedure. By default is TRUE if the session is interactive, and FALSE otherwise..

...

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

Value

Return an object of class 'mclustBIC' containing the Bayesian Information Criterion for the specified mixture models numbers of clusters. Auxiliary information returned as attributes.

The corresponding print method shows the matrix of values and the top models according to the BIC criterion.

References

Scrucca L., Fop M., Murphy T. B. and Raftery A. E. (2016) mclust 5: clustering, classification and density estimation using Gaussian finite mixture models, The R Journal, 8/1, pp. 205-233.

Fraley C. and Raftery A. E. (2002) Model-based clustering, discriminant analysis and density estimation, Journal of the American Statistical Association, 97/458, pp. 611-631.

Fraley C., Raftery A. E., Murphy T. B. and Scrucca L. (2012) mclust Version 4 for R: Normal Mixture Modeling for Model-Based Clustering, Classification, and Density Estimation. Technical Report No. 597, Department of Statistics, University of Washington.

See Also

priorControl, emControl, mclustModel, summary.mclustBIC, hc, me, mclustModelNames, mclust.options

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
irisBIC <- mclustBIC(iris[,-5])
irisBIC
plot(irisBIC)

## Not run: 
subset <- sample(1:nrow(iris), 100)
irisBIC <- mclustBIC(iris[,-5], initialization=list(subset = subset))
irisBIC
plot(irisBIC)

irisBIC1 <- mclustBIC(iris[,-5], G=seq(from=1,to=9,by=2), 
                    modelNames=c("EII", "EEI", "EEE"))
irisBIC1
plot(irisBIC1)
irisBIC2  <- mclustBIC(iris[,-5], G=seq(from=2,to=8,by=2), 
                       modelNames=c("VII", "VVI", "VVV"), x= irisBIC1)
irisBIC2
plot(irisBIC2)

## End(Not run)

nNoise <- 450
set.seed(0)
poissonNoise <- apply(apply( iris[,-5], 2, range), 2, function(x, n) 
                      runif(n, min = x[1]-.1, max = x[2]+.1), n = nNoise)
set.seed(0)
noiseInit <- sample(c(TRUE,FALSE),size=nrow(iris)+nNoise,replace=TRUE,
                    prob=c(3,1))
irisNdata <- rbind(iris[,-5], poissonNoise)
irisNbic <- mclustBIC(data = irisNdata, G = 1:5,
                      initialization = list(noise = noiseInit))
irisNbic
plot(irisNbic)

Example output

Package 'mclust' version 5.3
Type 'citation("mclust")' for citing this R package in publications.
Bayesian Information Criterion (BIC):
         EII        VII        EEI        VEI        EVI        VVI       EEE
1 -1804.0854 -1804.0854 -1522.1202 -1522.1202 -1522.1202 -1522.1202 -829.9782
2 -1123.4115 -1012.2352 -1042.9680  -956.2823 -1007.3082  -857.5515 -688.0972
3  -878.7651  -853.8145  -813.0506  -779.1565  -797.8356  -744.6356 -632.9658
4  -784.3102  -783.8267  -735.4820  -716.5253  -732.4576  -705.0688 -591.4097
5  -734.3865  -746.9931  -694.3922  -703.0523  -695.6736  -700.9100 -604.9299
6  -715.7148  -705.7813  -693.8005  -675.5832  -722.1517  -696.9024 -621.8177
7  -712.1014  -708.7210  -671.6757  -666.8672  -704.1649  -703.9925 -617.6212
8  -686.0967  -707.2610  -661.0846  -657.2447  -703.6602  -702.1138 -622.4221
9  -694.5242  -700.0220  -678.5986  -671.8247  -737.3109  -727.6346 -638.2076
        EVE       VEE       VVE       EEV       VEV       EVV       VVV
1 -829.9782 -829.9782 -829.9782 -829.9782 -829.9782 -829.9782 -829.9782
2 -657.2263 -656.3270 -605.1931 -644.5997 -561.7285 -658.3306 -574.0178
3 -618.6003 -605.3982 -589.5227 -610.0853 -562.5514 -621.5200 -580.8399
4 -648.3787 -611.9268 -618.6018 -646.0011 -603.9266 -663.1150 -628.9650
5 -612.7253 -609.6644 -627.9771 -621.6906 -635.2087 -666.4540 -683.8206
6 -655.4745 -609.3411 -645.2745 -669.7188 -681.3062 -729.2513 -711.5726
7 -664.2666 -616.0728 -669.3395 -711.3150 -715.2100 -768.6957 -728.5508
8 -687.8967 -627.0606 -703.5972 -750.1897 -724.1750 -798.7173 -801.7295
9        NA -640.7214 -731.3868 -799.6408 -810.1318 -854.4504 -835.9095

Top 3 models based on the BIC criterion:
    VEV,2     VEV,3     VVV,2 
-561.7285 -562.5514 -574.0178 
Bayesian Information Criterion (BIC):
         EII        VII        EEI        VEI        EVI        VVI       EEE
1 -1804.0854 -1804.0854 -1522.1202 -1522.1202 -1522.1202 -1522.1202 -829.9782
2 -1123.4114 -1012.2352 -1042.9679  -956.2823 -1007.3082  -857.5515 -688.0972
3  -878.7666  -853.8145  -813.0538  -779.1553  -797.8342  -744.6375 -632.9654
4  -784.3127  -783.8292  -735.4847  -716.5259  -732.4823  -705.0700 -591.4086
5  -734.3867  -746.9904  -694.3906  -703.0504  -695.6719  -700.9101 -604.9289
6  -715.7125  -705.7808  -693.7986  -675.5855  -722.1485  -696.9007 -621.8253
7  -731.8837  -709.3033  -713.1922  -687.6900  -761.8637  -722.2055 -638.4309
8  -725.0919  -717.1300  -691.4227  -672.9350  -740.3569  -729.9358 -629.0852
9  -694.5268  -701.2711  -678.5965  -665.7826  -743.1989  -740.9711 -638.2082
        EVE       VEE       VVE       EEV       VEV       EVV       VVV
1 -829.9782 -829.9782 -829.9782 -829.9782 -829.9782 -829.9782 -829.9782
2 -657.2263 -656.3270 -605.1931 -644.5997 -561.7285 -658.3306 -574.0178
3 -618.6000 -605.3981 -589.5181 -617.7035 -562.5517 -621.5197 -580.8395
4 -648.3780 -611.9263 -618.6012 -638.7250 -603.9257 -663.1157 -628.9647
5 -640.6303 -609.6667 -640.0614 -629.8687 -635.2082 -670.4989 -683.9737
6 -643.1971 -609.3408 -645.2004 -682.3578 -681.3061 -733.2602 -711.7280
7        NA        NA        NA -734.8783 -721.2375        NA        NA
8        NA        NA        NA -756.1232 -765.6005        NA        NA
9        NA        NA        NA -796.7592 -795.9902        NA        NA

Top 3 models based on the BIC criterion:
    VEV,2     VEV,3     VVV,2 
-561.7285 -562.5517 -574.0178 
Bayesian Information Criterion (BIC):
         EII        EEI       EEE
1 -1804.0854 -1522.1202 -829.9782
3  -878.7651  -813.0506 -632.9658
5  -734.3865  -694.3922 -604.9299
7  -712.1014  -671.6757 -617.6212
9  -694.5242  -678.5986 -638.2076

Top 3 models based on the BIC criterion:
    EEE,5     EEE,7     EEE,3 
-604.9299 -617.6212 -632.9658 
Bayesian Information Criterion (BIC):
         VII       VVI       VVV
2 -1012.2352 -857.5515 -574.0178
4  -783.8267 -705.0688 -628.9650
6  -705.7813 -696.9024 -711.5726
8  -707.2610 -702.1138 -801.7295

Top 3 models based on the BIC criterion:
    VVV,2     VVV,4     VVI,6 
-574.0178 -628.9650 -696.9024 
Bayesian Information Criterion (BIC):
        EII       VII       EEI       VEI       EVI       VVI       EEE
1 -5977.328 -5977.328 -5970.295 -5970.295 -5970.295 -5970.295 -5818.060
2 -5825.570 -5811.722 -5793.879 -5794.454 -5793.229 -5771.580 -5729.567
3 -5779.366 -5777.704 -5759.525 -5758.183 -5761.040 -5761.453 -5680.509
4 -5780.376 -5812.321 -5784.584 -5735.339 -5793.697 -5780.062 -5710.971
5 -5767.607 -5789.007 -5728.219 -5765.536 -5773.723 -5774.856 -5714.934
        EVE       VEE       VVE       EEV       VEV       EVV       VVV
1 -5818.031 -5818.060 -5818.031 -5818.060 -5818.060 -5818.060 -5818.060
2 -5712.330 -5701.825 -5691.572 -5703.593 -5668.291 -5716.441 -5681.329
3 -5695.809 -5676.159 -5717.836 -5703.388 -5708.722 -5730.896 -5744.728
4 -5736.719 -5704.428 -5763.248 -5760.517 -5762.098 -5797.446 -5816.570
5 -5759.483 -5728.421 -5758.260 -5841.477 -5824.459 -5850.659 -5878.636

Top 3 models based on the BIC criterion:
    VEV,2     VEE,3     EEE,3 
-5668.291 -5676.159 -5680.509 

mclust documentation built on Nov. 22, 2017, 5:05 p.m.