R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("mclust-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('mclust') Attaching package: 'mclust' The following object(s) are masked from package:stats : density > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "Defaults.Mclust" > > ### * Defaults.Mclust > > flush(stderr()); flush(stdout()) > > ### Name: Defaults.Mclust > ### Title: List of values controlling defaults for some MCLUST functions. > ### Aliases: Defaults.Mclust .Mclust > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > odd <- seq(1, 2*n, 2) > train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step XXX XXX 1 1 > even <- odd + 1 > test <- mclustDAtest(x[even, ], train) ## compute model densities > > data(iris) > irisMatrix <- iris[,1:4] > irisClass <- iris[,5] > > .Mclust $eps [1] 2.220446e-16 $tol [1] 1e-05 1e-05 $itmax [1] Inf Inf $equalPro [1] FALSE $warnSingular [1] TRUE $emModelNames [1] "EII" "VII" "EEI" "VEI" "EVI" "VVI" "EEE" "EEV" "VEV" "VVV" $hcModelName [1] "E" "VVV" $symbols [1] 17 0 10 4 11 18 6 7 3 16 2 12 8 15 1 9 14 13 5 > .Mclust <- mclustOptions(tol = 1.e-6, emModelNames = c("VII", "VVI", "VVV")) > .Mclust $tol [1] 1e-06 $eps [1] 2.220446e-16 $itmax [1] Inf Inf $equalPro [1] FALSE $emModelNames [1] "VII" "VVI" "VVV" $hcModelName [1] "V" "VVV" $warnSingular [1] TRUE $symbols [1] 17 0 10 4 11 18 6 7 3 16 2 12 8 15 1 9 14 13 5 > irisBic <- EMclust(irisMatrix) > summary(irisBic, irisMatrix) classification table: 1 2 50 100 uncertainty (quartiles): 0% 25% 50% 75% 100% 0.000000e+00 0.000000e+00 0.000000e+00 6.585066e-12 6.278349e-04 best BIC values: VVV,2 VVV,3 VII,9 -574.0178 -580.8390 -703.3339 best model: ellipsoidal, unconstrained > .Mclust <- mclustOptions() # restore defaults > .Mclust $tol [1] 1e-05 1e-05 $eps [1] 2.220446e-16 $itmax [1] Inf Inf $equalPro [1] FALSE $emModelNames [1] "EII" "VII" "EEI" "VEI" "EVI" "VVI" "EEE" "EEV" "VEV" "VVV" $hcModelName [1] "V" "VVV" $warnSingular [1] TRUE $symbols [1] 17 0 10 4 11 18 6 7 3 16 2 12 8 15 1 9 14 13 5 > > > > cleanEx(); ..nameEx <- "EMclust" > > ### * EMclust > > flush(stderr()); flush(stdout()) > > ### Name: EMclust > ### Title: BIC for Model-Based Clustering > ### Aliases: EMclust print.EMclust plot.EMclust > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > irisBic <- EMclust(irisMatrix) > irisBic BIC: EII VII EEI VEI EVI VVI EEE 1 -1804.0854 -1804.0854 -1527.1308 -1527.1308 -1527.1308 -1527.1308 -829.9782 2 -1123.4115 -1012.2352 -1047.9786 -961.2929 -1017.3295 -867.5728 -688.0972 3 -878.7652 -853.8133 -818.0635 -784.1658 -812.8672 -759.6687 -632.9658 4 -784.3098 -783.8263 -740.4955 -721.5350 -752.5491 -725.1132 -591.4097 5 -734.3863 -746.9928 -699.4019 -708.0611 -720.7265 -725.9635 -604.9287 6 -715.7147 -705.7813 -698.8104 -680.5938 -752.2155 -726.9666 -621.8183 7 -700.3690 -705.0659 -688.4205 -664.6910 -749.2664 -729.2289 -613.4585 8 -686.0964 -710.5799 -666.0947 -662.2667 -743.7443 -741.9637 -622.4215 9 -694.5239 -703.3490 -683.6092 -672.0079 -782.4065 -772.4925 -638.2063 EEV VEV VVV 1 -829.9782 -829.9782 -829.9782 2 -644.5997 -561.7285 -574.0178 3 -617.7022 -562.5519 -580.8400 4 -613.4447 -603.9274 -628.9642 5 -621.6908 -635.2096 -683.8194 6 -669.7087 -681.3057 -711.5716 7 -682.3451 -707.9405 -752.7982 8 -722.7178 -735.8582 -790.7023 9 -772.5045 -790.6323 -824.8824 > plot(irisBic) EII VII EEI VEI EVI VVI EEE EEV VEV VVV "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" > > irisBic <- EMclust(irisMatrix, subset = sample(1:nrow(irisMatrix), 100)) > irisBic BIC: EII VII EEI VEI EVI VVI EEE 1 -1804.0854 -1804.0854 -1527.1308 -1527.1308 -1527.1308 -1527.1308 -829.9782 2 -1123.4116 -1012.2352 -1047.9786 -961.2929 -1017.3295 -867.5728 -688.0972 3 -878.7653 -853.8165 -818.0610 -784.1679 -812.8661 -759.6694 -632.9652 4 -784.3108 -783.8298 -740.4956 -721.5354 -752.5156 -725.1118 -591.4094 5 -734.3874 -746.9927 -699.4026 NA -720.7265 -725.9629 -604.9298 6 -715.7124 -705.7836 -698.8104 NA -752.2143 -726.9658 -621.8182 7 -712.0975 -708.7197 -676.6880 NA -739.2378 -739.5564 -617.6088 8 -686.0980 -692.0668 -666.0958 NA -748.7062 -744.4220 -622.4214 9 -694.5252 -696.0619 -683.6097 NA -787.9744 -774.9495 -638.2059 EEV VEV VVV 1 -829.9782 -829.9782 -829.9782 2 -644.5997 -561.7285 -574.0178 3 -617.7023 -562.5520 -580.8404 4 -636.3807 -603.9266 -628.9638 5 -621.6905 -635.2088 -688.8399 6 -669.7110 -681.5409 NA 7 -703.2255 -711.3661 NA 8 -742.5131 -743.1589 NA 9 -793.7582 -787.0600 NA > plot(irisBic) EII VII EEI VEI EVI VVI EEE EEV VEV VVV "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" > > > > cleanEx(); ..nameEx <- "EMclustN" > > ### * EMclustN > > flush(stderr()); flush(stdout()) > > ### Name: EMclustN > ### Title: BIC for Model-Based Clustering with Poisson Noise > ### Aliases: EMclustN print.EMclustN plot.EMclustN > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > b <- apply( irisMatrix, 2, range) > n <- 450 > set.seed(0) > poissonNoise <- apply(b, 2, function(x, n=n) + runif(n, min = x[1]-0.1, max = x[2]+.1), n = n) > set.seed(0) > noiseInit <- sample(c(TRUE,FALSE),size=150+450,replace=TRUE,prob=c(3,1)) > Bic <- EMclustN(data=rbind(irisMatrix, poissonNoise), noise = noiseInit) > Bic BIC: EII VII EEI VEI EVI VVI EEE 0 -6043.735 -6043.735 -6043.735 -6043.735 -6043.735 -6043.735 -6043.735 1 -5977.328 -5977.328 -5976.692 -5976.692 -5976.692 -5976.692 -5818.060 2 -5825.570 -5811.722 -5800.276 -5800.851 -5806.023 -5784.374 -5729.567 3 -5779.366 -5777.704 -5765.922 -5764.580 -5780.230 -5780.644 -5680.509 4 -5780.376 -5812.321 -5790.981 -5741.736 -5819.284 -5805.649 -5710.971 5 -5767.607 -5789.007 -5734.616 -5771.933 -5805.708 -5806.840 -5714.934 6 -5790.424 -5811.528 -5759.626 -5803.767 -5850.202 -5857.511 -5734.718 7 -5807.684 -5842.744 -5796.150 -5828.035 -5899.564 -5903.362 -5749.537 8 -5798.622 -5865.036 -5801.046 -5856.021 -5937.121 -5956.888 -5781.116 9 -5821.209 -5888.689 -5822.848 -5881.425 -5977.930 -6002.969 -5803.894 EEV VEV VVV 0 -6043.735 -6043.735 -6043.735 1 -5818.060 -5818.060 -5818.060 2 -5703.593 -5668.291 -5681.329 3 -5703.388 -5708.722 -5744.728 4 -5760.517 -5762.098 -5816.570 5 -5841.477 -5824.459 -5878.636 6 -5852.945 -5880.614 -5933.795 7 -5936.221 -5942.740 -5990.736 8 -5994.617 -6001.226 -6037.668 9 -6053.952 -6030.744 -6104.476 > plot(Bic) EII VII EEI VEI EVI VVI EEE EEV VEV VVV "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" > > > > cleanEx(); ..nameEx <- "Mclust" > > ### * Mclust > > flush(stderr()); flush(stdout()) > > ### Name: Mclust > ### Title: Model-Based Clustering > ### Aliases: Mclust print.Mclust > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > irisMclust <- Mclust(irisMatrix) > > ## Not run: plot(irisMclust,irisMatrix) > > > > cleanEx(); ..nameEx <- "bic" > > ### * bic > > flush(stderr()); flush(stdout()) > > ### Name: bic > ### Title: BIC for Parameterized MVN Mixture Models > ### Aliases: bic > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > n <- nrow(irisMatrix) > d <- ncol(irisMatrix) > G <- 3 > > emEst <- me(modelName="VVI", data=irisMatrix, unmap(irisClass)) > names(emEst) [1] "n" "d" "G" "z" "mu" "sigma" [7] "decomp" "pro" "loglik" "Vinv" "modelName" > > args(bic) function (modelName, loglik, n, d, G, ...) NULL > bic(modelName="VVI",loglik=emEst$loglik,n=n,d=d,G=G) [1] -759.0592 > ## Not run: do.call("bic", emEst) ## alternative call > > > > cleanEx(); ..nameEx <- "bicE" > > ### * bicE > > flush(stderr()); flush(stdout()) > > ### Name: bicE > ### Title: BIC for a Parameterized MVN Mixture Model > ### Aliases: bicE bicV bicEII bicVII bicEEI bicVEI bicEVI bicVVI bicEEE > ### bicEEV bicVEV bicVVV > ### Keywords: cluster > > ### ** Examples > > ## To run an example, see man page for bic > ## Not run: > ##D data(iris) > ##D irisMatrix <- as.matrix(iris[,1:4]) > ##D irisClass <- iris[,5] > ##D > ##D n <- nrow(irisMatrix) > ##D d <- ncol(irisMatrix) > ##D G <- 3 > ##D > ##D emEst <- meVVI(data=irisMatrix, unmap(irisClass)) > ##D names(emEst) > ##D > ##D bicVVI(loglik=emEst$loglik, n=n, d=d, G=G) > ##D do.call("bicVVI", emEst) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "bicEMtrain" > > ### * bicEMtrain > > flush(stderr()); flush(stdout()) > > ### Name: bicEMtrain > ### Title: Select models in discriminant analysis using BIC > ### Aliases: bicEMtrain > ### Keywords: cluster > > ### ** Examples > > data(lansing) > odd <- seq(from=1, to=nrow(lansing), by=2) > round(bicEMtrain(lansing[odd,-3], labels=lansing[odd, 3]), 1) EII VII EEI VEI EVI VVI EEE EEV VEV VVV -512.1 -526.5 -520.0 -533.7 -539.5 -554.7 -519.7 -534.3 -549.7 -553.4 > > > > cleanEx(); ..nameEx <- "cdens" > > ### * cdens > > flush(stderr()); flush(stdout()) > > ### Name: cdens > ### Title: Component Density for Parameterized MVN Mixture Models > ### Aliases: cdens > ### Keywords: cluster > > ### ** Examples > > n <- 100 ## create artificial data > > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > clPairs(x, cl = xclass, sym = c("1","2")) ## display the data > > set.seed(0) > I <- sample(1:(2*n)) ## random ordering of the data > x <- x[I, ] > xclass <- xclass[I] > > odd <- seq(1, 2*n, by = 2) > oddBic <- EMclust(x[odd, ]) > oddSumry <- summary(oddBic, x[odd, ]) ## best parameter estimates > names(oddSumry) [1] "bic" "options" "classification" "uncertainty" [5] "n" "d" "G" "z" [9] "mu" "sigma" "decomp" "pro" [13] "loglik" "Vinv" "modelName" > > even <- odd + 1 > temp <- cdens(modelName = oddSumry$modelName, data = x[even, ], + mu = oddSumry$mu, decomp = oddSumry$decomp) > cbind(class = xclass[even], temp) class [1,] 1 1.164962e-02 1.851370e-04 [2,] 2 2.625179e-03 7.339071e-34 [3,] 1 4.528771e-25 1.511300e-02 [4,] 2 1.449957e-02 6.730790e-20 [5,] 2 4.752573e-03 1.298843e-07 [6,] 1 6.392054e-23 4.229208e-03 [7,] 2 8.820163e-03 1.849394e-47 [8,] 2 4.031732e-03 1.930225e-02 [9,] 2 1.555070e-02 1.881145e-21 [10,] 1 8.170215e-06 2.024394e-02 [11,] 2 2.249514e-03 5.007229e-73 [12,] 2 1.412937e-03 2.919489e-66 [13,] 1 1.001055e-36 2.423824e-03 [14,] 1 9.384679e-13 4.253494e-03 [15,] 2 2.216220e-02 4.942268e-03 [16,] 1 1.630467e-07 5.493755e-03 [17,] 1 5.061448e-12 1.129177e-02 [18,] 2 3.289897e-03 1.714523e-02 [19,] 2 6.338299e-04 8.179685e-04 [20,] 2 2.856026e-03 4.207216e-05 [21,] 2 2.698590e-03 6.020754e-36 [22,] 2 1.557294e-02 1.554993e-20 [23,] 2 1.201623e-03 8.029992e-03 [24,] 1 2.079666e-02 5.707858e-03 [25,] 2 4.807193e-03 6.335222e-68 [26,] 2 1.997646e-03 1.159067e-10 [27,] 1 5.652947e-18 1.008623e-02 [28,] 1 4.046642e-07 1.247986e-02 [29,] 1 1.123068e-18 8.522180e-03 [30,] 1 4.286980e-16 1.143311e-02 [31,] 2 2.475971e-03 5.132035e-11 [32,] 1 1.393206e-188 1.975134e-04 [33,] 1 2.411354e-17 1.748370e-02 [34,] 1 1.820755e-76 4.144932e-03 [35,] 2 1.720253e-02 3.373744e-15 [36,] 1 1.255086e-34 8.561872e-03 [37,] 1 1.129794e-30 5.834116e-03 [38,] 1 2.012338e-06 7.617146e-03 [39,] 2 1.664310e-02 2.374131e-06 [40,] 1 2.007031e-26 9.074208e-03 [41,] 1 4.490018e-49 9.195014e-03 [42,] 2 1.097167e-02 4.201040e-27 [43,] 2 4.564589e-03 6.331621e-21 [44,] 1 1.477308e-02 1.558031e-02 [45,] 1 5.126246e-04 1.622580e-02 [46,] 1 2.142645e-61 2.145691e-03 [47,] 2 2.767642e-03 1.258334e-28 [48,] 2 1.153222e-03 1.259790e-09 [49,] 2 1.512968e-02 6.807488e-17 [50,] 2 1.662945e-02 3.552012e-04 [51,] 2 4.735784e-03 2.124273e-02 [52,] 2 2.146339e-02 9.059759e-04 [53,] 1 4.975088e-09 8.574643e-03 [54,] 1 2.261371e-02 9.635912e-03 [55,] 2 1.355171e-02 8.718501e-27 [56,] 2 1.917169e-02 5.478821e-11 [57,] 1 9.792748e-09 1.790946e-02 [58,] 2 3.343286e-03 4.433212e-43 [59,] 2 1.327530e-03 1.622526e-34 [60,] 1 2.196466e-43 4.436308e-03 [61,] 1 1.354164e-11 1.191942e-02 [62,] 1 1.190013e-02 2.106942e-02 [63,] 2 2.274149e-02 1.973267e-02 [64,] 1 3.957590e-65 6.792652e-03 [65,] 1 2.009849e-36 1.138460e-02 [66,] 2 1.909979e-02 4.527706e-10 [67,] 2 1.315873e-02 5.998222e-12 [68,] 2 1.938245e-05 3.239063e-288 [69,] 2 4.082026e-03 2.564354e-55 [70,] 2 4.269906e-03 1.042268e-05 [71,] 2 2.084798e-02 1.596416e-02 [72,] 1 1.226432e-11 6.294609e-03 [73,] 1 2.098699e-02 7.060101e-04 [74,] 1 6.756948e-77 4.184353e-05 [75,] 2 5.273188e-03 1.220672e-04 [76,] 2 1.295437e-02 1.233738e-26 [77,] 2 1.913277e-03 9.624960e-32 [78,] 2 1.542997e-02 3.971898e-08 [79,] 2 1.289073e-02 2.339962e-03 [80,] 2 1.009653e-02 4.442570e-03 [81,] 1 6.379041e-23 1.371113e-02 [82,] 1 1.261826e-95 2.720278e-03 [83,] 1 4.727940e-08 1.045633e-02 [84,] 1 1.113215e-10 5.227016e-03 [85,] 2 1.192931e-02 2.541179e-31 [86,] 1 1.322648e-08 1.577701e-02 [87,] 2 1.419457e-02 2.904950e-17 [88,] 2 1.986987e-02 3.082201e-05 [89,] 2 8.277480e-03 2.243101e-18 [90,] 1 2.184112e-02 5.423656e-03 [91,] 1 4.646892e-59 5.628149e-03 [92,] 2 1.168424e-02 4.594097e-19 [93,] 1 9.044124e-27 9.729198e-03 [94,] 1 4.025607e-34 7.248183e-03 [95,] 1 5.720768e-68 3.945127e-03 [96,] 2 9.926307e-03 3.834954e-04 [97,] 1 2.706684e-18 3.978134e-03 [98,] 1 2.367816e-27 1.217631e-02 [99,] 1 5.224205e-55 2.235450e-03 [100,] 1 2.861691e-40 1.143043e-02 > > ## alternative call > > ## Not run: > ##D temp <- do.call( "cdens", c(list(data = x[even, ]), oddSumry)) > ##D cbind(class = xclass[even], temp) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "cdensE" > > ### * cdensE > > flush(stderr()); flush(stdout()) > > ### Name: cdensE > ### Title: Component Density for a Parameterized MVN Mixture Model > ### Aliases: cdensE cdensV cdensEII cdensVII cdensEEI cdensVEI cdensEVI > ### cdensVVI cdensEEE cdensEEV cdensVEV cdensVVV > ### Keywords: cluster > > ### ** Examples > > n <- 100 ## create artificial data > > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > clPairs(x, cl = xclass, sym = c("1","2")) ## display the data > > modelVII <- meVII(x, z = unmap(xclass)) > modelVVI <- meVVI(x, z = unmap(xclass)) > modelVVV <- meVVV(x, z = unmap(xclass)) > > names(modelVII) [1] "n" "d" "G" "z" "mu" "sigma" [7] "sigmasq" "decomp" "pro" "loglik" "Vinv" "modelName" > args(cdensVII) function (data, mu, sigmasq, eps, warnSingular, logarithm = FALSE, ...) NULL > cdenVII <- cdensVII(data = x, mu = modelVII$mu, pro = modelVII$pro, + decomp = modelVII$decomp) > names(modelVVI) [1] "n" "d" "G" "z" "mu" "sigma" [7] "decomp" "pro" "loglik" "Vinv" "modelName" > args(cdensVVI) function (data, mu, decomp, eps, warnSingular, logarithm = FALSE, ...) NULL > cdenVVI <- cdensVII(data = x, mu = modelVVI$mu, pro = modelVVI$pro, + decomp = modelVVI$decomp) > names(modelVVV) [1] "n" "d" "G" "z" "mu" "sigma" [7] "cholsigma" "pro" "loglik" "Vinv" "modelName" > args(cdensVVV) function (data, mu, eps, warnSingular, logarithm = FALSE, ...) NULL > cdenVVV <- cdensVVV( data = x, mu = modelVVV$mu, pro = modelVVV$pro, + cholsigma = modelVVV$cholsigma) > > cbind(class=xclass,VII=map(cdenVII),VVI=map(cdenVVI),VVV=map(cdenVVV)) class VII VVI VVV [1,] 1 1 2 1 [2,] 1 2 1 1 [3,] 1 2 1 1 [4,] 1 2 1 2 [5,] 1 2 2 1 [6,] 1 1 2 1 [7,] 1 1 2 1 [8,] 1 1 2 1 [9,] 1 2 1 1 [10,] 1 1 2 1 [11,] 1 2 1 1 [12,] 1 2 1 1 [13,] 1 2 1 2 [14,] 1 2 1 1 [15,] 1 1 2 1 [16,] 1 1 2 1 [17,] 1 2 2 1 [18,] 1 2 2 1 [19,] 1 2 2 1 [20,] 1 2 1 2 [21,] 1 2 1 1 [22,] 1 2 2 1 [23,] 1 2 2 1 [24,] 1 2 1 1 [25,] 1 2 2 1 [26,] 1 1 2 1 [27,] 1 1 2 1 [28,] 1 2 2 1 [29,] 1 1 2 1 [30,] 1 2 1 1 [31,] 1 1 2 1 [32,] 1 2 1 1 [33,] 1 1 2 1 [34,] 1 2 1 1 [35,] 1 1 2 1 [36,] 1 2 1 1 [37,] 1 1 2 1 [38,] 1 2 1 1 [39,] 1 2 1 1 [40,] 1 2 1 1 [41,] 1 1 2 1 [42,] 1 2 1 1 [43,] 1 2 1 1 [44,] 1 2 2 1 [45,] 1 2 1 1 [46,] 1 2 1 1 [47,] 1 2 2 1 [48,] 1 2 1 1 [49,] 1 2 2 1 [50,] 1 1 2 1 [51,] 1 1 2 1 [52,] 1 1 2 1 [53,] 1 2 1 2 [54,] 1 1 2 1 [55,] 1 1 2 1 [56,] 1 2 1 1 [57,] 1 2 1 1 [58,] 1 1 2 1 [59,] 1 2 1 2 [60,] 1 2 1 1 [61,] 1 2 2 1 [62,] 1 2 1 1 [63,] 1 1 2 1 [64,] 1 1 2 1 [65,] 1 1 2 1 [66,] 1 1 2 1 [67,] 1 2 1 1 [68,] 1 1 2 1 [69,] 1 2 1 1 [70,] 1 2 1 1 [71,] 1 1 2 1 [72,] 1 2 1 1 [73,] 1 2 1 1 [74,] 1 2 1 1 [75,] 1 2 1 1 [76,] 1 1 2 1 [77,] 1 1 2 1 [78,] 1 2 1 1 [79,] 1 2 1 1 [80,] 1 1 2 1 [81,] 1 2 1 2 [82,] 1 2 1 1 [83,] 1 2 1 1 [84,] 1 1 2 1 [85,] 1 2 2 1 [86,] 1 2 1 1 [87,] 1 2 2 1 [88,] 1 2 1 1 [89,] 1 2 1 1 [90,] 1 1 2 1 [91,] 1 2 1 2 [92,] 1 2 2 1 [93,] 1 1 2 1 [94,] 1 2 1 1 [95,] 1 1 2 1 [96,] 1 1 2 1 [97,] 1 2 2 1 [98,] 1 2 1 2 [99,] 1 2 1 1 [100,] 1 2 1 1 [101,] 2 2 1 2 [102,] 2 1 2 2 [103,] 2 2 2 2 [104,] 2 1 2 2 [105,] 2 2 1 2 [106,] 2 1 2 2 [107,] 2 2 1 2 [108,] 2 2 1 2 [109,] 2 2 1 2 [110,] 2 2 1 2 [111,] 2 1 2 2 [112,] 2 2 2 2 [113,] 2 1 2 2 [114,] 2 2 1 2 [115,] 2 2 2 2 [116,] 2 1 2 2 [117,] 2 2 1 2 [118,] 2 1 2 2 [119,] 2 2 2 2 [120,] 2 1 2 2 [121,] 2 2 2 2 [122,] 2 2 2 2 [123,] 2 1 2 2 [124,] 2 2 2 2 [125,] 2 1 2 2 [126,] 2 1 2 2 [127,] 2 1 2 2 [128,] 2 2 1 2 [129,] 2 1 2 2 [130,] 2 2 2 2 [131,] 2 1 2 2 [132,] 2 1 2 2 [133,] 2 2 1 2 [134,] 2 2 2 2 [135,] 2 2 2 2 [136,] 2 2 2 2 [137,] 2 2 2 1 [138,] 2 2 1 2 [139,] 2 2 1 2 [140,] 2 1 2 2 [141,] 2 2 2 2 [142,] 2 2 2 2 [143,] 2 2 2 1 [144,] 2 2 1 1 [145,] 2 2 1 1 [146,] 2 1 2 2 [147,] 2 2 2 1 [148,] 2 2 1 2 [149,] 2 2 1 2 [150,] 2 1 2 2 [151,] 2 2 1 1 [152,] 2 1 2 2 [153,] 2 2 2 2 [154,] 2 1 2 2 [155,] 2 2 1 1 [156,] 2 2 2 2 [157,] 2 2 1 2 [158,] 2 2 2 2 [159,] 2 2 1 2 [160,] 2 1 2 2 [161,] 2 2 2 2 [162,] 2 2 1 2 [163,] 2 2 2 2 [164,] 2 1 2 2 [165,] 2 2 1 2 [166,] 2 1 2 2 [167,] 2 2 1 1 [168,] 2 1 2 2 [169,] 2 2 1 2 [170,] 2 1 2 2 [171,] 2 1 2 2 [172,] 2 2 2 1 [173,] 2 2 2 2 [174,] 2 2 1 2 [175,] 2 1 2 2 [176,] 2 2 2 2 [177,] 2 1 2 2 [178,] 2 1 2 2 [179,] 2 1 2 2 [180,] 2 2 2 2 [181,] 2 2 1 2 [182,] 2 1 2 2 [183,] 2 1 2 2 [184,] 2 1 2 2 [185,] 2 2 2 2 [186,] 2 2 2 2 [187,] 2 1 2 2 [188,] 2 1 2 2 [189,] 2 2 1 2 [190,] 2 2 2 2 [191,] 2 1 2 2 [192,] 2 2 2 2 [193,] 2 2 1 1 [194,] 2 1 2 2 [195,] 2 2 2 2 [196,] 2 1 2 2 [197,] 2 1 2 2 [198,] 2 2 2 2 [199,] 2 2 1 2 [200,] 2 2 1 1 > > ## alternative call > > ## Not run: > ##D cdenVII <- do.call("cdensVII", c(list(data = x), modelVII)) > ##D cdenVVI <- do.call("cdensVVI", c(list(data = x), modelVVI)) > ##D cdenVVV <- do.call("cdensVVV", c(list(data = x), modelVVV)) > ##D > ##D cbind(class=xclass,VII=map(cdenVII),VVI=map(cdenVVI),VVV=map(cdenVVV)) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "clPairs" > > ### * clPairs > > flush(stderr()); flush(stdout()) > > ### Name: clPairs > ### Title: Pairwise Scatter Plots showing Classification > ### Aliases: clPairs > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > clPairs(irisMatrix, cl=irisClass, symbols=as.character(1:3)) > > > > cleanEx(); ..nameEx <- "classError" > > ### * classError > > flush(stderr()); flush(stdout()) > > ### Name: classError > ### Title: Classification error. > ### Aliases: classError classErrors > ### Keywords: cluster > > ### ** Examples > > a <- rep(1:3, 3) > a [1] 1 2 3 1 2 3 1 2 3 > b <- rep(c("A", "B", "C"), 3) > b [1] "A" "B" "C" "A" "B" "C" "A" "B" "C" > classError(a, b) [1] 0 > classErrors(a, b) [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE > > a <- sample(1:3, 9, replace = TRUE) > a [1] 1 2 2 3 1 3 3 2 2 > b <- sample(c("A", "B", "C"), 9, replace = TRUE) > b [1] "A" "A" "A" "C" "B" "C" "B" "C" "C" > classError(a, b) [1] 0.4444444 > > > > cleanEx(); ..nameEx <- "compareClass" > > ### * compareClass > > flush(stderr()); flush(stdout()) > > ### Name: compareClass > ### Title: Compare classifications. > ### Aliases: compareClass > ### Keywords: cluster > > ### ** Examples > > a <- rep(1:3, 3) > a [1] 1 2 3 1 2 3 1 2 3 > b <- rep(c("A", "B", "C"), 3) > b [1] "A" "B" "C" "A" "B" "C" "A" "B" "C" > compareClass(a, b) [1] 0 > a <- sample(1:3, 9, replace = TRUE) > a [1] 1 2 2 3 1 3 3 2 2 > b <- sample(c("A", "B", "C"), 9, replace = TRUE) > b [1] "A" "A" "A" "C" "B" "C" "B" "C" "C" > compareClass(a, b) [1] 0.6137466 > > > > cleanEx(); ..nameEx <- "coordProj" > > ### * coordProj > > flush(stderr()); flush(stdout()) > > ### Name: coordProj > ### Title: Coordinate projections of data in more than two dimensions > ### modelled by an MVN mixture. > ### Aliases: coordProj > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstepVVV(irisMatrix, unmap(irisClass)) > > par(pty = "s", mfrow = c(1,2)) > coordProj(irisMatrix,dimens=c(2,3), truth = irisClass, + mu = msEst$mu, sigma = msEst$sigma, z = msEst$z) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function > do.call("coordProj", c(list(data=irisMatrix, dimens=c(2,3), truth=irisClass), + msEst)) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "cv1EMtrain" > > ### * cv1EMtrain > > flush(stderr()); flush(stdout()) > > ### Name: cv1EMtrain > ### Title: Select discriminant models using cross validation > ### Aliases: cv1EMtrain > ### Keywords: cluster > > ### ** Examples > > data(lansing) > odd <- seq(from=1, to=nrow(lansing), by=2) > round(cv1EMtrain(data=lansing[odd,-3], labels=lansing[odd,3]), 3) EII VII EEI VEI EVI VVI EEE EEV VEV VVV 0.351 0.355 0.345 0.353 0.340 0.358 0.345 0.333 0.350 0.350 > > cv1Modd <- mstepEEV(data=lansing[odd,-3], z=unmap(lansing[odd,3])) > cv1Zodd <- do.call("estepEEV", c(cv1Modd, list(data=lansing[odd,-3])))$z > compareClass(map(cv1Zodd), lansing[odd,3]) [1] 0.1920861 > > even <- (1:nrow(lansing))[-odd] > cv1Zeven <- do.call("estepEEV", c(cv1Modd, list(data=lansing[even,-3])))$z > compareClass(map(cv1Zodd), lansing[odd,3])$error NULL > > > > cleanEx(); ..nameEx <- "decomp2sigma" > > ### * decomp2sigma > > flush(stderr()); flush(stdout()) > > ### Name: decomp2sigma > ### Title: Convert mixture component covariances to matrix form. > ### Aliases: decomp2sigma > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > meEst <- meVEV(irisMatrix, unmap(irisClass)) > names(meEst) [1] "n" "d" "G" "z" "mu" "sigma" [7] "decomp" "pro" "loglik" "Vinv" "modelName" > meEst$decomp $d [1] 4 $G [1] 3 $scale [1] 0.03748689 0.05792069 0.11417074 $shape [1] 6.8586540 1.0115189 0.6265406 0.2300583 $orientation , , 1 [,1] [,2] [,3] [,4] [1,] -0.66907840 -0.73414783 -0.0965439 -0.0635636 [2,] 0.59788401 -0.62067342 0.4900556 0.1309379 [3,] -0.43996277 0.27460747 0.8324495 0.1950675 [4,] -0.03607712 -0.01955027 -0.2399013 0.9699297 , , 2 [,1] [,2] [,3] [,4] [1,] 0.70585528 0.3292982 0.5956635 0.19625498 [2,] -0.66039545 0.5666772 0.3576279 0.33890568 [3,] 0.24389225 0.6842803 -0.6850974 0.05402453 [4,] -0.07850317 0.3196875 0.2189266 -0.91853594 , , 3 [,1] [,2] [,3] [,4] [1,] -0.7104631 -0.2167218 -0.64838923 -0.1669287 [2,] -0.3009582 0.7157065 -0.07068142 0.6262528 [3,] 0.5382163 0.4318488 -0.65459512 -0.3087637 [4,] 0.3391010 -0.5042841 -0.38223130 0.6961374 attr(,"def") [1] "Sigma = scale * t(O) %*% diag(shape) %*% O" > meEst$sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.13321137 0.10939003 0.019190731 0.011585616 [2,] 0.10939003 0.15495720 0.012099279 0.010010994 [3,] 0.01919073 0.01209928 0.028275013 0.005818105 [4,] 0.01158562 0.01001099 0.005818105 0.010695932 , , 2 [,1] [,2] [,3] [,4] [1,] 0.22571873 0.07613400 0.14689831 0.04335755 [2,] 0.07613400 0.08024559 0.07371597 0.03435387 [3,] 0.14689831 0.07371597 0.16611786 0.04951847 [4,] 0.04335755 0.03435387 0.04951847 0.03337847 , , 3 [,1] [,2] [,3] [,4] [1,] 0.42945634 0.10782887 0.33457093 0.06541466 [2,] 0.10782887 0.11595477 0.08903481 0.06133224 [3,] 0.33457093 0.08903481 0.36426991 0.08711096 [4,] 0.06541466 0.06133224 0.08711096 0.08666095 > > dec <- meEst$decomp > decomp2sigma(d=dec$d, G=dec$G, shape=dec$shape, scale=dec$scale, + orientation = dec$orientation) , , 1 [,1] [,2] [,3] [,4] [1,] 0.13321137 0.10939003 0.019190731 0.011585616 [2,] 0.10939003 0.15495720 0.012099279 0.010010994 [3,] 0.01919073 0.01209928 0.028275013 0.005818105 [4,] 0.01158562 0.01001099 0.005818105 0.010695932 , , 2 [,1] [,2] [,3] [,4] [1,] 0.22571873 0.07613400 0.14689831 0.04335755 [2,] 0.07613400 0.08024559 0.07371597 0.03435387 [3,] 0.14689831 0.07371597 0.16611786 0.04951847 [4,] 0.04335755 0.03435387 0.04951847 0.03337847 , , 3 [,1] [,2] [,3] [,4] [1,] 0.42945634 0.10782887 0.33457093 0.06541466 [2,] 0.10782887 0.11595477 0.08903481 0.06133224 [3,] 0.33457093 0.08903481 0.36426991 0.08711096 [4,] 0.06541466 0.06133224 0.08711096 0.08666095 attr(,"modelName") [1] "VEV" > ## Not run: > ##D do.call("decomp2sigma", meEst$decomp) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "dens" > > ### * dens > > flush(stderr()); flush(stdout()) > > ### Name: dens > ### Title: Density for Parameterized MVN Mixtures > ### Aliases: dens > ### Keywords: cluster > > ### ** Examples > > n <- 100 ## create artificial data > > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > clPairs(x, cl = xclass, sym = c("1","2")) ## display the data > > set.seed(0) > I <- sample(1:(2*n)) > x <- x[I, ] > xclass <- xclass[I] > > odd <- seq(1, 2*n, by = 2) > oddBic <- EMclust(x[odd, ]) > oddSumry <- summary(oddBic, x[odd, ]) ## best parameter estimates > names(oddSumry) [1] "bic" "options" "classification" "uncertainty" [5] "n" "d" "G" "z" [9] "mu" "sigma" "decomp" "pro" [13] "loglik" "Vinv" "modelName" > > oddDens <- dens(modelName = oddSumry$modelName, data = x, + mu = oddSumry$mu, decomp = oddSumry$decomp, pro = oddSumry$pro) > > ## Not run: > ##D oddDens <- do.call("dens", c(list(data = x), oddSumry)) ## alternative call > ## End(Not run) > > even <- odd + 1 > evenBic <- EMclust(x[even, ]) > evenSumry <- summary(evenBic, x[even, ]) ## best parameter estimates > evenDens <- do.call( "dens", c(list(data = x), evenSumry)) > > cbind(class = xclass, odd = oddDens, even = evenDens) class odd even [1,] 2 4.727763e-04 1.809758e-03 [2,] 1 5.413188e-03 5.941079e-03 [3,] 1 1.059600e-02 8.155675e-03 [4,] 2 1.197138e-03 3.250436e-03 [5,] 2 5.272099e-03 6.507195e-03 [6,] 1 8.221147e-03 6.299088e-03 [7,] 2 5.967790e-03 5.008272e-03 [8,] 2 6.612115e-03 5.035667e-03 [9,] 2 5.949187e-03 5.291991e-03 [10,] 2 2.167346e-03 3.541283e-03 [11,] 1 5.446748e-03 4.533414e-03 [12,] 1 2.300598e-03 2.430185e-03 [13,] 1 6.275102e-03 5.053478e-03 [14,] 2 4.022184e-03 3.093545e-03 [15,] 1 7.570165e-03 5.897048e-03 [16,] 2 1.233857e-02 1.202647e-02 [17,] 1 1.025242e-02 8.238918e-03 [18,] 2 7.091452e-03 6.582985e-03 [19,] 2 1.127547e-02 9.572207e-03 [20,] 1 1.101599e-02 9.207205e-03 [21,] 2 4.055242e-03 4.791421e-03 [22,] 2 1.025827e-03 2.175117e-03 [23,] 1 7.409025e-03 5.757014e-03 [24,] 2 6.443297e-04 1.906834e-03 [25,] 1 6.911470e-03 5.239462e-03 [26,] 1 1.318508e-03 1.535196e-03 [27,] 1 6.494876e-03 6.409511e-03 [28,] 1 2.313809e-03 2.827471e-03 [29,] 1 8.228138e-03 7.468430e-03 [30,] 2 1.279493e-02 1.394524e-02 [31,] 1 9.771816e-03 7.355320e-03 [32,] 1 2.988559e-03 3.752394e-03 [33,] 2 9.139416e-03 9.224334e-03 [34,] 1 6.142480e-03 5.810804e-03 [35,] 1 3.021860e-03 2.068292e-03 [36,] 2 1.082690e-02 1.125048e-02 [37,] 2 6.601662e-03 8.055455e-03 [38,] 2 7.339974e-04 2.052298e-03 [39,] 1 6.901253e-03 4.654038e-03 [40,] 2 1.325296e-03 2.837047e-03 [41,] 2 6.781599e-03 8.895145e-03 [42,] 2 1.230615e-03 7.725805e-04 [43,] 2 2.238889e-03 3.979650e-03 [44,] 2 7.101593e-03 6.219390e-03 [45,] 1 7.812540e-03 1.004807e-02 [46,] 2 4.916109e-03 6.397818e-03 [47,] 2 5.820792e-03 7.540683e-03 [48,] 1 1.258868e-02 1.400210e-02 [49,] 1 9.575579e-03 7.275976e-03 [50,] 2 2.192183e-03 1.088766e-03 [51,] 2 6.700238e-04 1.244588e-03 [52,] 2 9.109696e-04 2.050104e-03 [53,] 2 3.307401e-03 5.139657e-03 [54,] 1 5.486690e-03 3.367511e-03 [55,] 1 2.506468e-03 2.467854e-03 [56,] 1 6.788963e-03 6.691209e-03 [57,] 1 2.870619e-03 2.188364e-03 [58,] 1 4.635883e-03 3.998618e-03 [59,] 2 9.282799e-03 8.261068e-03 [60,] 1 6.219364e-03 5.065115e-03 [61,] 1 6.012740e-03 5.074310e-03 [62,] 2 1.129096e-03 2.396914e-03 [63,] 1 6.856423e-04 2.092335e-03 [64,] 1 1.074430e-04 3.756298e-05 [65,] 2 7.617272e-03 8.106298e-03 [66,] 1 9.510760e-03 7.277437e-03 [67,] 1 5.581998e-03 6.803648e-03 [68,] 1 2.254754e-03 1.637931e-03 [69,] 2 2.202371e-03 1.249623e-03 [70,] 2 7.844722e-03 7.045195e-03 [71,] 2 9.391654e-03 9.067921e-03 [72,] 1 4.657475e-03 3.971761e-03 [73,] 2 1.312807e-02 1.450338e-02 [74,] 1 3.173634e-03 2.988586e-03 [75,] 1 1.089312e-02 8.224524e-03 [76,] 1 4.144482e-03 3.434886e-03 [77,] 2 1.127106e-02 9.569213e-03 [78,] 2 7.590903e-03 8.638316e-03 [79,] 1 3.589575e-03 4.237873e-03 [80,] 1 4.936174e-03 5.731011e-03 [81,] 2 3.756003e-03 4.021870e-03 [82,] 1 5.001890e-03 3.890065e-03 [83,] 1 9.289213e-03 6.485464e-03 [84,] 2 5.003316e-03 5.946481e-03 [85,] 2 2.510686e-03 1.308666e-03 [86,] 2 2.081550e-03 4.400520e-03 [87,] 1 5.064149e-03 4.588178e-03 [88,] 1 1.521219e-02 1.386560e-02 [89,] 1 2.235381e-02 1.881156e-02 [90,] 1 9.060253e-03 6.492420e-03 [91,] 1 5.641704e-03 3.728229e-03 [92,] 1 1.167210e-03 2.295141e-03 [93,] 1 3.272931e-03 2.963283e-03 [94,] 2 1.262104e-03 3.372764e-03 [95,] 1 1.076452e-03 8.361397e-04 [96,] 2 5.258945e-04 1.716732e-03 [97,] 2 1.309896e-02 1.412187e-02 [98,] 2 6.899461e-03 7.469824e-03 [99,] 1 1.756517e-02 1.738891e-02 [100,] 2 7.776608e-03 6.953427e-03 [101,] 1 9.982102e-03 9.372470e-03 [102,] 2 1.371521e-02 1.251988e-02 [103,] 2 2.393589e-03 4.233655e-03 [104,] 2 1.028060e-02 1.020702e-02 [105,] 1 1.767116e-03 1.511173e-03 [106,] 1 4.664424e-03 5.000800e-03 [107,] 1 1.593029e-02 1.419086e-02 [108,] 1 1.555407e-02 1.353615e-02 [109,] 2 6.495850e-03 5.696717e-03 [110,] 2 6.179870e-03 6.118446e-03 [111,] 1 2.970140e-04 1.240624e-04 [112,] 2 8.742702e-03 8.486351e-03 [113,] 1 1.096410e-02 9.062437e-03 [114,] 1 9.742368e-03 7.400286e-03 [115,] 2 1.193240e-04 9.544931e-04 [116,] 2 1.524610e-03 6.833203e-04 [117,] 1 9.081673e-03 6.961739e-03 [118,] 2 6.053822e-04 1.963058e-03 [119,] 1 1.122567e-02 8.783089e-03 [120,] 1 2.413256e-03 2.038890e-03 [121,] 2 6.768907e-03 5.515166e-03 [122,] 1 6.483909e-03 5.195043e-03 [123,] 2 1.229057e-02 1.151264e-02 [124,] 1 1.688802e-02 1.501467e-02 [125,] 2 7.033141e-03 6.976137e-03 [126,] 2 2.110475e-02 1.971063e-02 [127,] 2 1.164453e-04 2.450045e-05 [128,] 1 3.695057e-03 2.652157e-03 [129,] 2 2.244355e-02 2.005654e-02 [130,] 1 6.192976e-03 4.697028e-03 [131,] 2 1.056222e-02 8.696731e-03 [132,] 2 8.709917e-03 8.430860e-03 [133,] 1 1.938329e-03 1.223173e-03 [134,] 2 6.000662e-03 7.562349e-03 [135,] 2 8.131409e-04 3.498996e-04 [136,] 2 8.838816e-06 2.990070e-05 [137,] 1 1.292323e-02 1.077099e-02 [138,] 2 1.861492e-03 1.012983e-03 [139,] 1 7.422596e-03 5.018987e-03 [140,] 2 1.952838e-03 3.181020e-03 [141,] 2 9.803528e-05 2.346327e-05 [142,] 2 1.819129e-02 1.812163e-02 [143,] 1 1.235253e-02 1.347051e-02 [144,] 1 3.424132e-03 5.400728e-03 [145,] 2 1.968770e-03 1.572634e-03 [146,] 1 9.954575e-03 1.004342e-02 [147,] 1 6.819442e-03 5.144081e-03 [148,] 1 2.276198e-05 2.560115e-04 [149,] 2 9.677056e-03 9.319217e-03 [150,] 2 2.471089e-03 4.273440e-03 [151,] 2 5.984644e-03 4.582979e-03 [152,] 2 5.907473e-03 5.889686e-03 [153,] 1 7.027660e-03 5.386361e-03 [154,] 2 8.724954e-04 2.418154e-03 [155,] 2 8.154851e-03 6.816876e-03 [156,] 2 7.036421e-03 7.896472e-03 [157,] 1 2.409198e-03 1.573651e-03 [158,] 2 7.151339e-03 8.407311e-03 [159,] 2 8.199809e-03 8.617847e-03 [160,] 2 7.020898e-03 8.106160e-03 [161,] 2 2.123854e-03 1.365622e-03 [162,] 1 7.458561e-03 5.838486e-03 [163,] 2 5.829327e-03 4.739272e-03 [164,] 1 1.479773e-03 1.168063e-03 [165,] 1 2.018715e-03 2.104971e-03 [166,] 1 5.688039e-03 7.131432e-03 [167,] 1 1.143119e-02 9.925072e-03 [168,] 1 2.843384e-03 2.591534e-03 [169,] 2 1.774863e-03 1.699395e-03 [170,] 2 5.440022e-03 5.223944e-03 [171,] 1 3.880675e-03 5.566914e-03 [172,] 1 8.582362e-03 8.484288e-03 [173,] 2 3.405119e-03 3.195267e-03 [174,] 2 6.473030e-03 7.289670e-03 [175,] 1 2.263773e-02 1.999091e-02 [176,] 2 9.077855e-03 9.286784e-03 [177,] 1 1.149164e-02 1.128246e-02 [178,] 2 3.774709e-03 3.048449e-03 [179,] 2 9.879176e-04 2.317969e-03 [180,] 1 1.291037e-02 1.409533e-02 [181,] 2 8.448174e-03 1.000625e-02 [182,] 1 3.061592e-03 2.918318e-03 [183,] 1 7.526854e-03 5.724529e-03 [184,] 2 5.328265e-03 6.616881e-03 [185,] 2 1.965823e-02 1.681755e-02 [186,] 1 5.292475e-03 4.435344e-03 [187,] 1 1.129595e-02 8.836430e-03 [188,] 1 3.942856e-03 4.848634e-03 [189,] 2 6.472019e-04 2.205337e-04 [190,] 1 2.146064e-03 2.484350e-03 [191,] 1 8.515050e-03 7.274765e-03 [192,] 2 4.735222e-03 5.589506e-03 [193,] 2 8.485393e-03 9.194183e-03 [194,] 1 2.164020e-03 4.135535e-03 [195,] 2 7.865838e-03 8.431487e-03 [196,] 1 6.623649e-03 4.782581e-03 [197,] 2 3.002574e-03 4.037352e-03 [198,] 1 1.216037e-03 1.431567e-03 [199,] 1 5.504643e-03 4.233971e-03 [200,] 1 6.217908e-03 4.732847e-03 > > > > cleanEx(); ..nameEx <- "density" > > ### * density > > flush(stderr()); flush(stdout()) > > ### Name: density > ### Title: Kernel Density Estimation > ### Aliases: density print.density > ### Keywords: cluster distribution smooth > > ### ** Examples > > plot(density(c(-20,rep(0,98),20)), xlim = c(-4,4))# IQR = 0 > > # The Old Faithful geyser data > data(faithful) > d <- density(faithful$eruptions, bw = "sj") > d Call: density(faithful$eruptions, bw = "sj") Data: c(3.6, 1.8, 3.333, 2.283, 4.533, 2.883, 4.7, 3.6, 1.95, 4.35, 1.833, 3.917, 4.2, 1.75, 4.7, 2.167, 1.75, 4.8, 1.6, 4.25, 1.8, 1.75, 3.45, 3.067, 4.533, 3.6, 1.967, 4.083, 3.85, 4.433, 4.3, 4.467, 3.367, 4.033, 3.833, 2.017, 1.867, 4.833, 1.833, 4.783, 4.35, 1.883, 4.567, 1.75, 4.533, 3.317, 3.833, 2.1, 4.633, 2, 4.8, 4.716, 1.833, 4.833, 1.733, 4.883, 3.717, 1.667, 4.567, 4.317, 2.233, 4.5, 1.75, 4.8, 1.817, 4.4, 4.167, 4.7, 2.067, 4.7, 4.033, 1.967, 4.5, 4, 1.983, 5.067, 2.017, 4.567, 3.883, 3.6, 4.133, 4.333, 4.1, 2.633, 4.067, 4.933, 3.95, 4.517, 2.167, 4, 2.2, 4.333, 1.867, 4.817, 1.833, 4.3, 4.667, 3.75, 1.867, 4.9, 2.483, 4.367, 2.1, 4.5, 4.05, 1.867, 4.7, 1.783, 4.85, 3.683, 4.733, 2.3, 4.9, 4.417, 1.7, 4.633, 2.317, 4.6, 1.817, 4.417, 2.617, 4.067, 4.25, 1.967, 4.6, 3.767, 1.917, 4.5, 2.267, 4.65, 1.867, 4.167, 2.8, 4.333, 1.833, 4.383, 1.883, 4.933, 2.033, 3.733, 4.233, 2.233, 4.533, 4.817, 4.333, 1.983, 4.633, 2.017, 5.1, 1.8, 5.033, 4, 2.4, 4.6, 3.567, 4, 4.5, 4.083, 1.8, 3.967, 2.2, 4.15, 2, 3.833, 3.5, 4.583, 2.367, 5, 1.933, 4.617, 1.917, 2.083, 4.583, 3.333, 4.167, 4.333, 4.5, 2.417, 4, 4.167, 1.883, 4.583, 4.25, 3.767, 2.033, 4.433, 4.083, 1.833, 4.417, 2.183, 4.8, 1.833, 4.8, 4.1, 3.966, 4.233, 3.5, 4.366, 2.25, 4.667, 2.1, 4.35, 4.133, 1.867, 4.6, 1.783, 4.367, 3.85, 1.933, 4.5, 2.383, 4.7, 1.867, 3.833, 3.417, 4.233, 2.4, 4.8, 2, 4.15, 1.867, 4.267, 1.75, 4.483, 4, 4.117, 4.083, 4.267, 3.917, 4.55, 4.083, 2.417, 4.183, 2.217, 4.45, 1.883, 1.85, 4.283, 3.95, 2.333, 4.15, 2.35, 4.933, 2.9, 4.583, 3.833, 2.083, 4.367, 2.133, 4.35, 2.2, 4.45, 3.567, 4.5, 4.15, 3.817, 3.917, 4.45, 2, 4.283, 4.767, 4.533, 1.85, 4.25, 1.983, 2.25, 4.75, 4.117, 2.15, 4.417, 1.817, 4.467) (272 obs.); Bandwidth 'bw' = 0.14 x y Min. :1.180 Min. :0.0001834 1st Qu.:2.265 1st Qu.:0.0422638 Median :3.350 Median :0.1709243 Mean :3.350 Mean :0.2301726 3rd Qu.:4.435 3rd Qu.:0.4134348 Max. :5.520 Max. :0.5945634 > plot(d) > dmc <- density(faithful$eruptions, method="mclust") > plot(dmc, type = "n") > polygon(dmc, col = "wheat") > lines(d, col="red") > > ## Missing values: > x <- xx <- faithful$eruptions > x[i.out <- sample(length(x), 10)] <- NA > doRmc <- density(x=x, method="mclust", na.rm = TRUE) > lines(doRmc, col="blue") > doR <- density(x, bw = 0.15, na.rm = TRUE) > lines(doR, col = "green") > rug(x) > points(xx[i.out], rep(0.01, 10)) > > ## function formals returns something different now the original > ## density function is masked... > base.density <- if(exists("density", envir = NULL)) { + get("density", envir = NULL) + } else if (methods::existsFunction("density.default", + where = asNamespace("stats"))) + stats::density.default else stats::density > > (kernels <- eval(formals(base.density)$kernel)) [1] "gaussian" "epanechnikov" "rectangular" "triangular" "biweight" [6] "cosine" "optcosine" > > ## show the kernels in the R parametrization > plot (density(0, bw = 1), xlab = "", + main="R's density() kernels with bw = 1") > for(i in 2:length(kernels)) + lines(density(0, bw = 1, kern = kernels[i]), col = i) > legend(1.5,.4, legend = kernels, col = seq(kernels), + lty = 1, cex = .8, y.int = 1) > > data(precip) > bw <- bw.SJ(precip) ## sensible automatic choice > plot(density(precip, bw = bw, n = 2^13)) > lines(density(precip, G=2:5, method="mclust"), col="red") Warning in summary.EMclust(EMclust(x, G = G), x) : BIC maximized at lower limit on G > rug(precip) > > > > cleanEx(); ..nameEx <- "em" > > ### * em > > flush(stderr()); flush(stdout()) > > ### Name: em > ### Title: EM algorithm starting with E-step for parameterized MVN mixture > ### models. > ### Aliases: em > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstep(modelName = "EEE", data = irisMatrix, + z = unmap(irisClass)) > names(msEst) [1] "n" "d" "G" "mu" "sigma" "Sigma" [7] "cholSigma" "pro" "modelName" > > em(modelName = msEst$modelName, data = irisMatrix, + mu = msEst$mu, Sigma = msEst$Sigma, pro = msEst$pro) $n [1] 150 $d [1] 4 $G [1] 3 $mu 1 2 3 [1,] 5.006 5.942204 6.574579 [2,] 3.428 2.760815 2.980676 [3,] 1.462 4.258445 5.538942 [4,] 0.246 1.319151 2.024796 $sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 , , 2 [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 , , 3 [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 $Sigma [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 attr(,"def") [1] "Sigma = t(cholSigma) %*% cholSigma" $cholSigma [,1] [,2] [,3] [,4] [1,] -0.51372910 -0.17492719 -0.33017364 -0.07657259 [2,] 0.09086667 0.28523852 -0.02315803 0.05822273 [3,] 0.16416400 0.05413867 -0.27730960 -0.06503526 [4,] 0.03763333 0.03205600 0.04181200 0.16201670 attr(,"def") [1] "Sigma = t(cholSigma) %*% cholSigma" $pro [1] 0.3333333 0.3295291 0.3371375 $z [,1] [,2] [,3] [1,] 1.000000e+00 5.669389e-22 2.970668e-42 [2,] 1.000000e+00 7.125511e-18 2.890550e-37 [3,] 1.000000e+00 2.209921e-19 5.645717e-39 [4,] 1.000000e+00 1.944369e-16 4.493925e-35 [5,] 1.000000e+00 2.969620e-22 1.819554e-42 [6,] 1.000000e+00 7.746074e-21 1.005427e-39 [7,] 1.000000e+00 2.519429e-18 5.970904e-37 [8,] 1.000000e+00 5.638578e-20 1.231056e-39 [9,] 1.000000e+00 2.778048e-15 1.088991e-33 [10,] 1.000000e+00 1.193692e-18 1.753502e-38 [11,] 1.000000e+00 1.635161e-23 3.372329e-44 [12,] 1.000000e+00 2.937431e-18 3.124729e-37 [13,] 1.000000e+00 1.517011e-18 1.969537e-38 [14,] 1.000000e+00 1.843982e-19 1.764184e-39 [15,] 1.000000e+00 6.849292e-30 1.303566e-52 [16,] 1.000000e+00 3.245264e-27 7.704284e-48 [17,] 1.000000e+00 1.264758e-24 7.386154e-45 [18,] 1.000000e+00 6.462169e-21 1.584880e-40 [19,] 1.000000e+00 2.203157e-22 2.328338e-42 [20,] 1.000000e+00 5.749059e-22 1.456245e-41 [21,] 1.000000e+00 1.272471e-19 2.601003e-39 [22,] 1.000000e+00 3.035910e-20 4.610963e-39 [23,] 1.000000e+00 1.681457e-24 2.334188e-45 [24,] 1.000000e+00 1.247580e-14 1.126055e-31 [25,] 1.000000e+00 2.033636e-15 2.214427e-33 [26,] 1.000000e+00 2.297938e-16 2.933735e-35 [27,] 1.000000e+00 6.480706e-17 6.730469e-35 [28,] 1.000000e+00 2.066760e-21 1.569681e-41 [29,] 1.000000e+00 1.082360e-21 4.850018e-42 [30,] 1.000000e+00 1.529968e-16 4.000996e-35 [31,] 1.000000e+00 2.920907e-16 6.532168e-35 [32,] 1.000000e+00 2.112491e-19 2.006593e-38 [33,] 1.000000e+00 1.833782e-26 6.732546e-48 [34,] 1.000000e+00 3.568839e-28 6.559131e-50 [35,] 1.000000e+00 1.360613e-17 9.355103e-37 [36,] 1.000000e+00 1.748091e-21 6.118695e-42 [37,] 1.000000e+00 1.848029e-24 8.856622e-46 [38,] 1.000000e+00 6.322278e-23 1.239791e-43 [39,] 1.000000e+00 6.778306e-17 9.552703e-36 [40,] 1.000000e+00 2.323565e-20 3.386508e-40 [41,] 1.000000e+00 1.772656e-21 2.999433e-41 [42,] 1.000000e+00 1.458475e-11 3.636199e-29 [43,] 1.000000e+00 3.158065e-18 2.712042e-37 [44,] 1.000000e+00 1.817425e-15 3.227861e-32 [45,] 1.000000e+00 4.013405e-17 1.057569e-34 [46,] 1.000000e+00 1.970937e-16 5.605941e-35 [47,] 1.000000e+00 4.461935e-22 5.242944e-42 [48,] 1.000000e+00 4.744169e-18 3.942102e-37 [49,] 1.000000e+00 3.968032e-23 1.225902e-43 [50,] 1.000000e+00 2.952916e-20 3.803732e-40 [51,] 4.352061e-18 9.999271e-01 7.285356e-05 [52,] 1.462104e-19 9.991833e-01 8.167043e-04 [53,] 4.326581e-22 9.969243e-01 3.075740e-03 [54,] 3.588876e-22 9.997272e-01 2.727797e-04 [55,] 8.685517e-23 9.968195e-01 3.180529e-03 [56,] 8.313347e-23 9.983021e-01 1.697924e-03 [57,] 3.067079e-22 9.793448e-01 2.065525e-02 [58,] 5.113810e-14 9.999999e-01 1.031644e-07 [59,] 1.272609e-19 9.999241e-01 7.588810e-05 [60,] 8.975128e-21 9.992664e-01 7.336194e-04 [61,] 3.442085e-18 9.999991e-01 8.743942e-07 [62,] 5.603197e-20 9.990125e-01 9.874887e-04 [63,] 9.656653e-18 9.999995e-01 4.518974e-07 [64,] 1.491160e-23 9.942156e-01 5.784381e-03 [65,] 5.275521e-14 9.999981e-01 1.854263e-06 [66,] 4.551187e-17 9.999694e-01 3.064952e-05 [67,] 5.482635e-24 9.671064e-01 3.289363e-02 [68,] 3.956205e-16 9.999994e-01 6.381923e-07 [69,] 5.338555e-27 9.786346e-01 2.136543e-02 [70,] 2.149035e-17 9.999977e-01 2.333318e-06 [71,] 2.269907e-28 1.338383e-01 8.661617e-01 [72,] 1.564633e-16 9.999930e-01 6.999013e-06 [73,] 1.862337e-28 8.664919e-01 1.335081e-01 [74,] 4.204653e-22 9.996599e-01 3.400895e-04 [75,] 1.496225e-17 9.999834e-01 1.663712e-05 [76,] 4.048066e-18 9.999412e-01 5.881490e-05 [77,] 1.811813e-22 9.990449e-01 9.551325e-04 [78,] 9.733911e-27 7.032941e-01 2.967059e-01 [79,] 4.207095e-23 9.914214e-01 8.578608e-03 [80,] 1.686652e-11 1.000000e+00 1.168802e-08 [81,] 1.691014e-17 9.999979e-01 2.062222e-06 [82,] 1.705135e-15 9.999998e-01 2.029185e-07 [83,] 2.383037e-16 9.999970e-01 2.965664e-06 [84,] 4.543859e-32 1.255609e-01 8.744391e-01 [85,] 8.944225e-25 9.290885e-01 7.091151e-02 [86,] 7.853508e-21 9.883971e-01 1.160287e-02 [87,] 5.759078e-21 9.985336e-01 1.466369e-03 [88,] 7.047203e-23 9.997609e-01 2.391093e-04 [89,] 4.510692e-18 9.999302e-01 6.984723e-05 [90,] 7.703797e-21 9.998338e-01 1.662373e-04 [91,] 6.639378e-23 9.993841e-01 6.159223e-04 [92,] 6.134157e-22 9.979127e-01 2.087322e-03 [93,] 5.814465e-18 9.999918e-01 8.248956e-06 [94,] 2.678609e-14 9.999999e-01 8.822342e-08 [95,] 5.126445e-21 9.996812e-01 3.187501e-04 [96,] 1.410433e-17 9.999784e-01 2.163084e-05 [97,] 2.670627e-19 9.998703e-01 1.296855e-04 [98,] 2.540730e-18 9.999627e-01 3.733285e-05 [99,] 8.473985e-11 1.000000e+00 1.640967e-08 [100,] 5.099820e-19 9.999235e-01 7.651826e-05 [101,] 8.752565e-53 1.844658e-09 1.000000e+00 [102,] 2.587892e-38 6.236363e-04 9.993764e-01 [103,] 1.986727e-42 2.318538e-05 9.999768e-01 [104,] 1.180532e-38 7.486688e-04 9.992513e-01 [105,] 3.099804e-46 9.518578e-07 9.999990e-01 [106,] 1.307361e-48 7.687368e-07 9.999992e-01 [107,] 9.267670e-34 2.246431e-02 9.775357e-01 [108,] 4.933987e-42 1.873452e-04 9.998127e-01 [109,] 4.505583e-42 2.970581e-04 9.997029e-01 [110,] 1.055915e-46 6.784148e-08 9.999999e-01 [111,] 2.974828e-32 7.725660e-03 9.922743e-01 [112,] 1.617173e-37 1.493449e-03 9.985066e-01 [113,] 5.629068e-39 1.532789e-04 9.998467e-01 [114,] 7.280330e-41 1.177402e-04 9.998823e-01 [115,] 3.555665e-46 3.558495e-07 9.999996e-01 [116,] 1.471997e-40 1.075125e-05 9.999892e-01 [117,] 1.771439e-35 4.654684e-03 9.953453e-01 [118,] 7.138648e-45 8.218517e-07 9.999992e-01 [119,] 1.899015e-58 1.906714e-09 1.000000e+00 [120,] 5.082160e-33 2.972470e-01 7.027530e-01 [121,] 6.864466e-43 3.648876e-06 9.999964e-01 [122,] 8.039862e-38 3.586891e-04 9.996413e-01 [123,] 3.747574e-49 1.512670e-06 9.999985e-01 [124,] 2.931140e-31 9.409549e-02 9.059045e-01 [125,] 8.774784e-40 4.563353e-05 9.999544e-01 [126,] 2.005765e-36 2.684624e-03 9.973154e-01 [127,] 8.506186e-30 1.616826e-01 8.383174e-01 [128,] 4.664639e-30 8.868082e-02 9.113192e-01 [129,] 4.765225e-44 8.543916e-06 9.999915e-01 [130,] 5.127429e-32 1.448711e-01 8.551289e-01 [131,] 2.089865e-41 2.206495e-04 9.997794e-01 [132,] 1.902049e-36 4.134090e-04 9.995866e-01 [133,] 8.931905e-46 1.825407e-06 9.999982e-01 [134,] 2.029625e-28 7.432053e-01 2.567947e-01 [135,] 3.219380e-35 7.082646e-02 9.291735e-01 [136,] 4.365673e-45 2.536647e-06 9.999975e-01 [137,] 3.772459e-45 2.458322e-07 9.999998e-01 [138,] 2.894065e-35 3.983245e-03 9.960168e-01 [139,] 2.370290e-29 1.236116e-01 8.763884e-01 [140,] 2.331576e-36 6.383548e-04 9.993616e-01 [141,] 3.151247e-45 5.888272e-07 9.999994e-01 [142,] 5.807134e-36 2.983685e-04 9.997016e-01 [143,] 2.587892e-38 6.236363e-04 9.993764e-01 [144,] 5.118189e-46 5.166787e-07 9.999995e-01 [145,] 1.083147e-46 9.508309e-08 9.999999e-01 [146,] 3.855859e-39 4.781458e-05 9.999522e-01 [147,] 8.908459e-36 6.189358e-03 9.938106e-01 [148,] 4.421495e-35 2.180277e-03 9.978197e-01 [149,] 2.042704e-41 3.621223e-06 9.999964e-01 [150,] 1.040288e-33 9.114476e-03 9.908855e-01 $loglik [1] -256.3541 $Vinv NULL $modelName [1] "EEE" attr(,"info") iterations error 5.000000e+00 1.766510e-06 > ## Not run: > ##D do.call("em", c(list(data = irisMatrix), msEst)) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "emE" > > ### * emE > > flush(stderr()); flush(stdout()) > > ### Name: emE > ### Title: EM algorithm starting with E-step for a parameterized MVN > ### mixture model. > ### Aliases: emE emV emEII emVII emEEI emVEI emEVI emVVI emEEE emEEV emVEV > ### emVVV > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstepEEE(data = irisMatrix, z = unmap(irisClass)) > names(msEst) [1] "n" "d" "G" "mu" "sigma" "Sigma" [7] "cholSigma" "pro" "modelName" > > emEEE(data = irisMatrix, mu = msEst$mu, pro = msEst$pro, + cholSigma = msEst$cholSigma) $n [1] 150 $d [1] 4 $G [1] 3 $mu 1 2 3 [1,] 5.006 5.942204 6.574579 [2,] 3.428 2.760815 2.980676 [3,] 1.462 4.258445 5.538942 [4,] 0.246 1.319151 2.024796 $sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 , , 2 [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 , , 3 [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 $Sigma [,1] [,2] [,3] [,4] [1,] 0.26391759 0.08986519 0.16961981 0.03933757 [2,] 0.08986519 0.11196054 0.05115079 0.03000199 [3,] 0.16961981 0.05115079 0.18645154 0.04196883 [4,] 0.03933757 0.03000199 0.04196883 0.03973224 attr(,"def") [1] "Sigma = t(cholSigma) %*% cholSigma" $cholSigma [,1] [,2] [,3] [,4] [1,] -0.5137291 -0.1749272 -0.33017364 -0.07657259 [2,] 0.0000000 0.2852385 -0.02315803 0.05822273 [3,] 0.0000000 0.0000000 -0.27730960 -0.06503526 [4,] 0.0000000 0.0000000 0.00000000 0.16201670 attr(,"def") [1] "Sigma = t(cholSigma) %*% cholSigma" $pro [1] 0.3333333 0.3295291 0.3371375 $z [,1] [,2] [,3] [1,] 1.000000e+00 5.669389e-22 2.970668e-42 [2,] 1.000000e+00 7.125511e-18 2.890550e-37 [3,] 1.000000e+00 2.209921e-19 5.645717e-39 [4,] 1.000000e+00 1.944369e-16 4.493925e-35 [5,] 1.000000e+00 2.969620e-22 1.819554e-42 [6,] 1.000000e+00 7.746074e-21 1.005427e-39 [7,] 1.000000e+00 2.519429e-18 5.970904e-37 [8,] 1.000000e+00 5.638578e-20 1.231056e-39 [9,] 1.000000e+00 2.778048e-15 1.088991e-33 [10,] 1.000000e+00 1.193692e-18 1.753502e-38 [11,] 1.000000e+00 1.635161e-23 3.372329e-44 [12,] 1.000000e+00 2.937431e-18 3.124729e-37 [13,] 1.000000e+00 1.517011e-18 1.969537e-38 [14,] 1.000000e+00 1.843982e-19 1.764184e-39 [15,] 1.000000e+00 6.849292e-30 1.303566e-52 [16,] 1.000000e+00 3.245264e-27 7.704284e-48 [17,] 1.000000e+00 1.264758e-24 7.386154e-45 [18,] 1.000000e+00 6.462169e-21 1.584880e-40 [19,] 1.000000e+00 2.203157e-22 2.328338e-42 [20,] 1.000000e+00 5.749059e-22 1.456245e-41 [21,] 1.000000e+00 1.272471e-19 2.601003e-39 [22,] 1.000000e+00 3.035910e-20 4.610963e-39 [23,] 1.000000e+00 1.681457e-24 2.334188e-45 [24,] 1.000000e+00 1.247580e-14 1.126055e-31 [25,] 1.000000e+00 2.033636e-15 2.214427e-33 [26,] 1.000000e+00 2.297938e-16 2.933735e-35 [27,] 1.000000e+00 6.480706e-17 6.730469e-35 [28,] 1.000000e+00 2.066760e-21 1.569681e-41 [29,] 1.000000e+00 1.082360e-21 4.850018e-42 [30,] 1.000000e+00 1.529968e-16 4.000996e-35 [31,] 1.000000e+00 2.920907e-16 6.532168e-35 [32,] 1.000000e+00 2.112491e-19 2.006593e-38 [33,] 1.000000e+00 1.833782e-26 6.732546e-48 [34,] 1.000000e+00 3.568839e-28 6.559131e-50 [35,] 1.000000e+00 1.360613e-17 9.355103e-37 [36,] 1.000000e+00 1.748091e-21 6.118695e-42 [37,] 1.000000e+00 1.848029e-24 8.856622e-46 [38,] 1.000000e+00 6.322278e-23 1.239791e-43 [39,] 1.000000e+00 6.778306e-17 9.552703e-36 [40,] 1.000000e+00 2.323565e-20 3.386508e-40 [41,] 1.000000e+00 1.772656e-21 2.999433e-41 [42,] 1.000000e+00 1.458475e-11 3.636199e-29 [43,] 1.000000e+00 3.158065e-18 2.712042e-37 [44,] 1.000000e+00 1.817425e-15 3.227861e-32 [45,] 1.000000e+00 4.013405e-17 1.057569e-34 [46,] 1.000000e+00 1.970937e-16 5.605941e-35 [47,] 1.000000e+00 4.461935e-22 5.242944e-42 [48,] 1.000000e+00 4.744169e-18 3.942102e-37 [49,] 1.000000e+00 3.968032e-23 1.225902e-43 [50,] 1.000000e+00 2.952916e-20 3.803732e-40 [51,] 4.352061e-18 9.999271e-01 7.285356e-05 [52,] 1.462104e-19 9.991833e-01 8.167043e-04 [53,] 4.326581e-22 9.969243e-01 3.075740e-03 [54,] 3.588876e-22 9.997272e-01 2.727797e-04 [55,] 8.685517e-23 9.968195e-01 3.180529e-03 [56,] 8.313347e-23 9.983021e-01 1.697924e-03 [57,] 3.067079e-22 9.793448e-01 2.065525e-02 [58,] 5.113810e-14 9.999999e-01 1.031644e-07 [59,] 1.272609e-19 9.999241e-01 7.588810e-05 [60,] 8.975128e-21 9.992664e-01 7.336194e-04 [61,] 3.442085e-18 9.999991e-01 8.743942e-07 [62,] 5.603197e-20 9.990125e-01 9.874887e-04 [63,] 9.656653e-18 9.999995e-01 4.518974e-07 [64,] 1.491160e-23 9.942156e-01 5.784381e-03 [65,] 5.275521e-14 9.999981e-01 1.854263e-06 [66,] 4.551187e-17 9.999694e-01 3.064952e-05 [67,] 5.482635e-24 9.671064e-01 3.289363e-02 [68,] 3.956205e-16 9.999994e-01 6.381923e-07 [69,] 5.338555e-27 9.786346e-01 2.136543e-02 [70,] 2.149035e-17 9.999977e-01 2.333318e-06 [71,] 2.269907e-28 1.338383e-01 8.661617e-01 [72,] 1.564633e-16 9.999930e-01 6.999013e-06 [73,] 1.862337e-28 8.664919e-01 1.335081e-01 [74,] 4.204653e-22 9.996599e-01 3.400895e-04 [75,] 1.496225e-17 9.999834e-01 1.663712e-05 [76,] 4.048066e-18 9.999412e-01 5.881490e-05 [77,] 1.811813e-22 9.990449e-01 9.551325e-04 [78,] 9.733911e-27 7.032941e-01 2.967059e-01 [79,] 4.207095e-23 9.914214e-01 8.578608e-03 [80,] 1.686652e-11 1.000000e+00 1.168802e-08 [81,] 1.691014e-17 9.999979e-01 2.062222e-06 [82,] 1.705135e-15 9.999998e-01 2.029185e-07 [83,] 2.383037e-16 9.999970e-01 2.965664e-06 [84,] 4.543859e-32 1.255609e-01 8.744391e-01 [85,] 8.944225e-25 9.290885e-01 7.091151e-02 [86,] 7.853508e-21 9.883971e-01 1.160287e-02 [87,] 5.759078e-21 9.985336e-01 1.466369e-03 [88,] 7.047203e-23 9.997609e-01 2.391093e-04 [89,] 4.510692e-18 9.999302e-01 6.984723e-05 [90,] 7.703797e-21 9.998338e-01 1.662373e-04 [91,] 6.639378e-23 9.993841e-01 6.159223e-04 [92,] 6.134157e-22 9.979127e-01 2.087322e-03 [93,] 5.814465e-18 9.999918e-01 8.248956e-06 [94,] 2.678609e-14 9.999999e-01 8.822342e-08 [95,] 5.126445e-21 9.996812e-01 3.187501e-04 [96,] 1.410433e-17 9.999784e-01 2.163084e-05 [97,] 2.670627e-19 9.998703e-01 1.296855e-04 [98,] 2.540730e-18 9.999627e-01 3.733285e-05 [99,] 8.473985e-11 1.000000e+00 1.640967e-08 [100,] 5.099820e-19 9.999235e-01 7.651826e-05 [101,] 8.752565e-53 1.844658e-09 1.000000e+00 [102,] 2.587892e-38 6.236363e-04 9.993764e-01 [103,] 1.986727e-42 2.318538e-05 9.999768e-01 [104,] 1.180532e-38 7.486688e-04 9.992513e-01 [105,] 3.099804e-46 9.518578e-07 9.999990e-01 [106,] 1.307361e-48 7.687368e-07 9.999992e-01 [107,] 9.267670e-34 2.246431e-02 9.775357e-01 [108,] 4.933987e-42 1.873452e-04 9.998127e-01 [109,] 4.505583e-42 2.970581e-04 9.997029e-01 [110,] 1.055915e-46 6.784148e-08 9.999999e-01 [111,] 2.974828e-32 7.725660e-03 9.922743e-01 [112,] 1.617173e-37 1.493449e-03 9.985066e-01 [113,] 5.629068e-39 1.532789e-04 9.998467e-01 [114,] 7.280330e-41 1.177402e-04 9.998823e-01 [115,] 3.555665e-46 3.558495e-07 9.999996e-01 [116,] 1.471997e-40 1.075125e-05 9.999892e-01 [117,] 1.771439e-35 4.654684e-03 9.953453e-01 [118,] 7.138648e-45 8.218517e-07 9.999992e-01 [119,] 1.899015e-58 1.906714e-09 1.000000e+00 [120,] 5.082160e-33 2.972470e-01 7.027530e-01 [121,] 6.864466e-43 3.648876e-06 9.999964e-01 [122,] 8.039862e-38 3.586891e-04 9.996413e-01 [123,] 3.747574e-49 1.512670e-06 9.999985e-01 [124,] 2.931140e-31 9.409549e-02 9.059045e-01 [125,] 8.774784e-40 4.563353e-05 9.999544e-01 [126,] 2.005765e-36 2.684624e-03 9.973154e-01 [127,] 8.506186e-30 1.616826e-01 8.383174e-01 [128,] 4.664639e-30 8.868082e-02 9.113192e-01 [129,] 4.765225e-44 8.543916e-06 9.999915e-01 [130,] 5.127429e-32 1.448711e-01 8.551289e-01 [131,] 2.089865e-41 2.206495e-04 9.997794e-01 [132,] 1.902049e-36 4.134090e-04 9.995866e-01 [133,] 8.931905e-46 1.825407e-06 9.999982e-01 [134,] 2.029625e-28 7.432053e-01 2.567947e-01 [135,] 3.219380e-35 7.082646e-02 9.291735e-01 [136,] 4.365673e-45 2.536647e-06 9.999975e-01 [137,] 3.772459e-45 2.458322e-07 9.999998e-01 [138,] 2.894065e-35 3.983245e-03 9.960168e-01 [139,] 2.370290e-29 1.236116e-01 8.763884e-01 [140,] 2.331576e-36 6.383548e-04 9.993616e-01 [141,] 3.151247e-45 5.888272e-07 9.999994e-01 [142,] 5.807134e-36 2.983685e-04 9.997016e-01 [143,] 2.587892e-38 6.236363e-04 9.993764e-01 [144,] 5.118189e-46 5.166787e-07 9.999995e-01 [145,] 1.083147e-46 9.508309e-08 9.999999e-01 [146,] 3.855859e-39 4.781458e-05 9.999522e-01 [147,] 8.908459e-36 6.189358e-03 9.938106e-01 [148,] 4.421495e-35 2.180277e-03 9.978197e-01 [149,] 2.042704e-41 3.621223e-06 9.999964e-01 [150,] 1.040288e-33 9.114476e-03 9.908855e-01 $loglik [1] -256.3541 $Vinv NULL $modelName [1] "EEE" attr(,"info") iterations error 5.000000e+00 1.766510e-06 > ## Not run: > ##D do.call("emEEE", c(list(data=irisMatrix), msEst)) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "estep" > > ### * estep > > flush(stderr()); flush(stdout()) > > ### Name: estep > ### Title: E-step for parameterized MVN mixture models. > ### Aliases: estep > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstep(modelName = "EII", data = irisMatrix, + z = unmap(irisClass)) > names(msEst) [1] "n" "d" "G" "mu" "sigma" "sigmasq" [7] "Sigma" "decomp" "pro" "modelName" > > estep(modelName = msEst$modelName, data = irisMatrix, + mu = msEst$mu, sigmasq = msEst$sigmasq, pro = msEst$pro) $n [1] 150 $d [1] 4 $G [1] 3 $z [,1] [,2] [,3] [1,] 1.000000e+00 2.803384e-16 2.385590e-34 [2,] 1.000000e+00 7.327699e-16 1.308337e-34 [3,] 1.000000e+00 1.323453e-17 5.432319e-37 [4,] 1.000000e+00 4.734701e-16 6.206020e-35 [5,] 1.000000e+00 9.644772e-17 6.074008e-35 [6,] 1.000000e+00 3.745645e-13 7.110633e-29 [7,] 1.000000e+00 3.962220e-17 5.263751e-36 [8,] 1.000000e+00 1.530343e-15 1.745542e-33 [9,] 1.000000e+00 5.012695e-17 8.729744e-37 [10,] 1.000000e+00 1.493770e-15 4.553180e-34 [11,] 1.000000e+00 4.946353e-15 4.909613e-32 [12,] 1.000000e+00 2.874117e-15 3.251952e-33 [13,] 1.000000e+00 1.898603e-16 1.366666e-35 [14,] 1.000000e+00 2.965476e-20 1.765968e-41 [15,] 1.000000e+00 5.679989e-17 3.628138e-34 [16,] 1.000000e+00 6.232567e-15 1.539704e-30 [17,] 1.000000e+00 2.030556e-16 1.196559e-33 [18,] 1.000000e+00 5.792085e-16 7.888847e-34 [19,] 1.000000e+00 1.838770e-12 7.077675e-28 [20,] 1.000000e+00 1.007591e-15 4.932475e-33 [21,] 1.000000e+00 8.003305e-13 2.988659e-29 [22,] 1.000000e+00 3.239263e-15 2.212908e-32 [23,] 1.000000e+00 4.293936e-21 1.455266e-41 [24,] 1.000000e+00 1.684971e-12 6.043532e-29 [25,] 1.000000e+00 8.089809e-13 1.237726e-29 [26,] 1.000000e+00 5.879016e-14 9.233078e-32 [27,] 1.000000e+00 4.281258e-14 2.980294e-31 [28,] 1.000000e+00 3.431956e-15 1.078274e-32 [29,] 1.000000e+00 8.148416e-16 9.369497e-34 [30,] 1.000000e+00 3.725137e-15 2.067596e-33 [31,] 1.000000e+00 1.082762e-14 8.120565e-33 [32,] 1.000000e+00 7.954596e-14 1.340679e-30 [33,] 1.000000e+00 1.170395e-16 5.229103e-34 [34,] 1.000000e+00 1.545756e-16 1.980569e-33 [35,] 1.000000e+00 3.086285e-15 1.505679e-33 [36,] 1.000000e+00 1.316358e-17 8.441335e-37 [37,] 1.000000e+00 5.208699e-16 1.073153e-33 [38,] 1.000000e+00 2.498955e-17 6.344799e-36 [39,] 1.000000e+00 4.915683e-18 4.121235e-38 [40,] 1.000000e+00 2.858709e-15 5.053241e-33 [41,] 1.000000e+00 4.731249e-17 1.745341e-35 [42,] 1.000000e+00 4.189706e-16 3.337718e-36 [43,] 1.000000e+00 2.030322e-18 2.239061e-38 [44,] 1.000000e+00 1.174537e-13 2.402226e-30 [45,] 1.000000e+00 3.840153e-12 9.692964e-28 [46,] 1.000000e+00 8.104734e-16 1.494506e-34 [47,] 1.000000e+00 3.196024e-15 2.328846e-32 [48,] 1.000000e+00 4.643069e-17 2.929807e-36 [49,] 1.000000e+00 2.647914e-15 1.695928e-32 [50,] 1.000000e+00 3.633460e-16 1.516762e-34 [51,] 4.414980e-22 3.552072e-01 6.447928e-01 [52,] 1.058716e-18 9.643661e-01 3.563387e-02 [53,] 1.636093e-24 9.729657e-02 9.027034e-01 [54,] 2.934788e-13 9.999989e-01 1.061514e-06 [55,] 1.418016e-20 9.269163e-01 7.308372e-02 [56,] 6.343133e-17 9.996119e-01 3.881470e-04 [57,] 2.880441e-20 8.010121e-01 1.989879e-01 [58,] 8.884593e-05 9.999112e-01 4.919936e-11 [59,] 5.157533e-20 9.481313e-01 5.186869e-02 [60,] 3.557001e-11 9.999997e-01 3.315240e-07 [61,] 1.889301e-07 9.999998e-01 2.501339e-10 [62,] 2.902400e-15 9.997677e-01 2.323394e-04 [63,] 7.313376e-14 9.999980e-01 2.017871e-06 [64,] 8.929576e-20 9.771962e-01 2.280376e-02 [65,] 4.113055e-09 9.999999e-01 1.162238e-07 [66,] 1.420914e-18 9.695112e-01 3.048878e-02 [67,] 6.717402e-17 9.991564e-01 8.435834e-04 [68,] 3.551802e-13 9.999960e-01 3.972232e-06 [69,] 4.586821e-20 9.961084e-01 3.891551e-03 [70,] 1.064136e-11 9.999996e-01 3.545649e-07 [71,] 8.183483e-21 8.135526e-01 1.864474e-01 [72,] 6.299772e-14 9.999708e-01 2.918159e-05 [73,] 3.889743e-23 7.726455e-01 2.273545e-01 [74,] 2.487187e-19 9.921199e-01 7.880054e-03 [75,] 5.333824e-17 9.983183e-01 1.681674e-03 [76,] 1.728900e-18 9.826147e-01 1.738533e-02 [77,] 5.532435e-23 4.900301e-01 5.099699e-01 [78,] 6.253220e-26 4.638985e-02 9.536101e-01 [79,] 3.533406e-18 9.957718e-01 4.228244e-03 [80,] 3.378235e-08 1.000000e+00 1.222238e-08 [81,] 8.372344e-11 9.999999e-01 8.373227e-08 [82,] 1.133646e-09 1.000000e+00 2.195897e-08 [83,] 3.573559e-12 9.999982e-01 1.792814e-06 [84,] 4.604035e-24 5.142138e-01 4.857862e-01 [85,] 2.345187e-16 9.996486e-01 3.514185e-04 [86,] 1.545648e-17 9.866927e-01 1.330734e-02 [87,] 1.499551e-21 5.950215e-01 4.049785e-01 [88,] 1.071821e-18 9.988635e-01 1.136484e-03 [89,] 5.293950e-13 9.999898e-01 1.023051e-05 [90,] 7.105513e-13 9.999986e-01 1.396314e-06 [91,] 1.238318e-15 9.999678e-01 3.223258e-05 [92,] 9.214775e-19 9.888907e-01 1.110928e-02 [93,] 3.504393e-13 9.999963e-01 3.724099e-06 [94,] 3.056837e-05 9.999694e-01 6.648361e-11 [95,] 2.144228e-14 9.999838e-01 1.615563e-05 [96,] 8.934438e-14 9.999764e-01 2.359935e-05 [97,] 2.779082e-14 9.999671e-01 3.293310e-05 [98,] 1.863063e-16 9.992991e-01 7.008920e-04 [99,] 5.368673e-03 9.946313e-01 1.595603e-11 [100,] 1.170520e-13 9.999879e-01 1.205306e-05 [101,] 9.342372e-40 7.331981e-07 9.999993e-01 [102,] 1.355795e-24 3.827313e-01 6.172687e-01 [103,] 1.415993e-40 5.197756e-07 9.999995e-01 [104,] 7.078729e-32 1.098448e-03 9.989016e-01 [105,] 3.935241e-37 1.071799e-05 9.999893e-01 [106,] 3.078989e-51 1.334794e-10 1.000000e+00 [107,] 1.370446e-16 9.999492e-01 5.076321e-05 [108,] 7.578449e-45 3.159087e-08 1.000000e+00 [109,] 1.221627e-36 5.811402e-05 9.999419e-01 [110,] 1.046280e-44 3.956327e-09 1.000000e+00 [111,] 1.775399e-27 9.010916e-03 9.909891e-01 [112,] 1.518738e-29 7.823942e-03 9.921761e-01 [113,] 2.041398e-34 6.231995e-05 9.999377e-01 [114,] 5.660664e-24 6.529490e-01 3.470510e-01 [115,] 7.166625e-27 4.895157e-02 9.510484e-01 [116,] 5.879819e-31 6.051577e-04 9.993948e-01 [117,] 1.789429e-31 9.501963e-04 9.990498e-01 [118,] 2.364301e-52 7.544743e-12 1.000000e+00 [119,] 7.542749e-57 4.302226e-12 1.000000e+00 [120,] 1.181638e-23 8.890101e-01 1.109899e-01 [121,] 4.869149e-38 2.102690e-06 9.999979e-01 [122,] 3.284881e-22 8.215690e-01 1.784310e-01 [123,] 1.223858e-52 7.611372e-11 1.000000e+00 [124,] 5.342028e-24 3.865481e-01 6.134519e-01 [125,] 6.054033e-36 1.127952e-05 9.999887e-01 [126,] 2.085175e-40 4.388139e-07 9.999996e-01 [127,] 1.763260e-22 6.698002e-01 3.301998e-01 [128,] 9.097872e-23 5.007794e-01 4.992206e-01 [129,] 4.988533e-34 1.984470e-04 9.998016e-01 [130,] 3.019952e-37 8.392597e-06 9.999916e-01 [131,] 1.422424e-43 8.290819e-08 9.999999e-01 [132,] 1.174192e-48 1.088190e-10 1.000000e+00 [133,] 1.508646e-34 1.239971e-04 9.998760e-01 [134,] 1.254623e-24 2.841190e-01 7.158810e-01 [135,] 2.771605e-29 2.548075e-02 9.745192e-01 [136,] 9.024027e-47 2.580492e-09 1.000000e+00 [137,] 2.490666e-34 3.296144e-05 9.999670e-01 [138,] 7.025706e-31 1.283507e-03 9.987165e-01 [139,] 1.751245e-21 7.873985e-01 2.126015e-01 [140,] 1.493664e-33 8.353069e-05 9.999165e-01 [141,] 1.420120e-36 8.621217e-06 9.999914e-01 [142,] 5.196881e-31 4.407646e-04 9.995592e-01 [143,] 1.355795e-24 3.827313e-01 6.172687e-01 [144,] 5.782379e-40 5.741210e-07 9.999994e-01 [145,] 5.062652e-38 1.718831e-06 9.999983e-01 [146,] 2.055977e-31 5.095741e-04 9.994904e-01 [147,] 7.527149e-26 1.785571e-01 8.214429e-01 [148,] 6.202938e-29 4.995365e-03 9.950046e-01 [149,] 5.809956e-31 4.638463e-04 9.995362e-01 [150,] 4.398339e-24 2.979812e-01 7.020188e-01 $loglik [1] -414.6980 $modelName [1] "EII" > ## Not run: > ##D do.call("estep", c(list(data = irisMatrix), msEst)) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "estepE" > > ### * estepE > > flush(stderr()); flush(stdout()) > > ### Name: estepE > ### Title: E-step in the EM algorithm for a parameterized MVN mixture > ### model. > ### Aliases: estepE estepV estepEII estepVII estepEEI estepVEI estepEVI > ### estepVVI estepEEE estepEEV estepVEV estepVVV > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstepEII(data = irisMatrix, z = unmap(irisClass)) > names(msEst) [1] "n" "d" "G" "mu" "sigma" "sigmasq" [7] "Sigma" "decomp" "pro" "modelName" > > estepEII(data = irisMatrix, mu = msEst$mu, pro = msEst$pro, + sigmasq = msEst$sigmasq) $n [1] 150 $d [1] 4 $G [1] 3 $z [,1] [,2] [,3] [1,] 1.000000e+00 2.803384e-16 2.385590e-34 [2,] 1.000000e+00 7.327699e-16 1.308337e-34 [3,] 1.000000e+00 1.323453e-17 5.432319e-37 [4,] 1.000000e+00 4.734701e-16 6.206020e-35 [5,] 1.000000e+00 9.644772e-17 6.074008e-35 [6,] 1.000000e+00 3.745645e-13 7.110633e-29 [7,] 1.000000e+00 3.962220e-17 5.263751e-36 [8,] 1.000000e+00 1.530343e-15 1.745542e-33 [9,] 1.000000e+00 5.012695e-17 8.729744e-37 [10,] 1.000000e+00 1.493770e-15 4.553180e-34 [11,] 1.000000e+00 4.946353e-15 4.909613e-32 [12,] 1.000000e+00 2.874117e-15 3.251952e-33 [13,] 1.000000e+00 1.898603e-16 1.366666e-35 [14,] 1.000000e+00 2.965476e-20 1.765968e-41 [15,] 1.000000e+00 5.679989e-17 3.628138e-34 [16,] 1.000000e+00 6.232567e-15 1.539704e-30 [17,] 1.000000e+00 2.030556e-16 1.196559e-33 [18,] 1.000000e+00 5.792085e-16 7.888847e-34 [19,] 1.000000e+00 1.838770e-12 7.077675e-28 [20,] 1.000000e+00 1.007591e-15 4.932475e-33 [21,] 1.000000e+00 8.003305e-13 2.988659e-29 [22,] 1.000000e+00 3.239263e-15 2.212908e-32 [23,] 1.000000e+00 4.293936e-21 1.455266e-41 [24,] 1.000000e+00 1.684971e-12 6.043532e-29 [25,] 1.000000e+00 8.089809e-13 1.237726e-29 [26,] 1.000000e+00 5.879016e-14 9.233078e-32 [27,] 1.000000e+00 4.281258e-14 2.980294e-31 [28,] 1.000000e+00 3.431956e-15 1.078274e-32 [29,] 1.000000e+00 8.148416e-16 9.369497e-34 [30,] 1.000000e+00 3.725137e-15 2.067596e-33 [31,] 1.000000e+00 1.082762e-14 8.120565e-33 [32,] 1.000000e+00 7.954596e-14 1.340679e-30 [33,] 1.000000e+00 1.170395e-16 5.229103e-34 [34,] 1.000000e+00 1.545756e-16 1.980569e-33 [35,] 1.000000e+00 3.086285e-15 1.505679e-33 [36,] 1.000000e+00 1.316358e-17 8.441335e-37 [37,] 1.000000e+00 5.208699e-16 1.073153e-33 [38,] 1.000000e+00 2.498955e-17 6.344799e-36 [39,] 1.000000e+00 4.915683e-18 4.121235e-38 [40,] 1.000000e+00 2.858709e-15 5.053241e-33 [41,] 1.000000e+00 4.731249e-17 1.745341e-35 [42,] 1.000000e+00 4.189706e-16 3.337718e-36 [43,] 1.000000e+00 2.030322e-18 2.239061e-38 [44,] 1.000000e+00 1.174537e-13 2.402226e-30 [45,] 1.000000e+00 3.840153e-12 9.692964e-28 [46,] 1.000000e+00 8.104734e-16 1.494506e-34 [47,] 1.000000e+00 3.196024e-15 2.328846e-32 [48,] 1.000000e+00 4.643069e-17 2.929807e-36 [49,] 1.000000e+00 2.647914e-15 1.695928e-32 [50,] 1.000000e+00 3.633460e-16 1.516762e-34 [51,] 4.414980e-22 3.552072e-01 6.447928e-01 [52,] 1.058716e-18 9.643661e-01 3.563387e-02 [53,] 1.636093e-24 9.729657e-02 9.027034e-01 [54,] 2.934788e-13 9.999989e-01 1.061514e-06 [55,] 1.418016e-20 9.269163e-01 7.308372e-02 [56,] 6.343133e-17 9.996119e-01 3.881470e-04 [57,] 2.880441e-20 8.010121e-01 1.989879e-01 [58,] 8.884593e-05 9.999112e-01 4.919936e-11 [59,] 5.157533e-20 9.481313e-01 5.186869e-02 [60,] 3.557001e-11 9.999997e-01 3.315240e-07 [61,] 1.889301e-07 9.999998e-01 2.501339e-10 [62,] 2.902400e-15 9.997677e-01 2.323394e-04 [63,] 7.313376e-14 9.999980e-01 2.017871e-06 [64,] 8.929576e-20 9.771962e-01 2.280376e-02 [65,] 4.113055e-09 9.999999e-01 1.162238e-07 [66,] 1.420914e-18 9.695112e-01 3.048878e-02 [67,] 6.717402e-17 9.991564e-01 8.435834e-04 [68,] 3.551802e-13 9.999960e-01 3.972232e-06 [69,] 4.586821e-20 9.961084e-01 3.891551e-03 [70,] 1.064136e-11 9.999996e-01 3.545649e-07 [71,] 8.183483e-21 8.135526e-01 1.864474e-01 [72,] 6.299772e-14 9.999708e-01 2.918159e-05 [73,] 3.889743e-23 7.726455e-01 2.273545e-01 [74,] 2.487187e-19 9.921199e-01 7.880054e-03 [75,] 5.333824e-17 9.983183e-01 1.681674e-03 [76,] 1.728900e-18 9.826147e-01 1.738533e-02 [77,] 5.532435e-23 4.900301e-01 5.099699e-01 [78,] 6.253220e-26 4.638985e-02 9.536101e-01 [79,] 3.533406e-18 9.957718e-01 4.228244e-03 [80,] 3.378235e-08 1.000000e+00 1.222238e-08 [81,] 8.372344e-11 9.999999e-01 8.373227e-08 [82,] 1.133646e-09 1.000000e+00 2.195897e-08 [83,] 3.573559e-12 9.999982e-01 1.792814e-06 [84,] 4.604035e-24 5.142138e-01 4.857862e-01 [85,] 2.345187e-16 9.996486e-01 3.514185e-04 [86,] 1.545648e-17 9.866927e-01 1.330734e-02 [87,] 1.499551e-21 5.950215e-01 4.049785e-01 [88,] 1.071821e-18 9.988635e-01 1.136484e-03 [89,] 5.293950e-13 9.999898e-01 1.023051e-05 [90,] 7.105513e-13 9.999986e-01 1.396314e-06 [91,] 1.238318e-15 9.999678e-01 3.223258e-05 [92,] 9.214775e-19 9.888907e-01 1.110928e-02 [93,] 3.504393e-13 9.999963e-01 3.724099e-06 [94,] 3.056837e-05 9.999694e-01 6.648361e-11 [95,] 2.144228e-14 9.999838e-01 1.615563e-05 [96,] 8.934438e-14 9.999764e-01 2.359935e-05 [97,] 2.779082e-14 9.999671e-01 3.293310e-05 [98,] 1.863063e-16 9.992991e-01 7.008920e-04 [99,] 5.368673e-03 9.946313e-01 1.595603e-11 [100,] 1.170520e-13 9.999879e-01 1.205306e-05 [101,] 9.342372e-40 7.331981e-07 9.999993e-01 [102,] 1.355795e-24 3.827313e-01 6.172687e-01 [103,] 1.415993e-40 5.197756e-07 9.999995e-01 [104,] 7.078729e-32 1.098448e-03 9.989016e-01 [105,] 3.935241e-37 1.071799e-05 9.999893e-01 [106,] 3.078989e-51 1.334794e-10 1.000000e+00 [107,] 1.370446e-16 9.999492e-01 5.076321e-05 [108,] 7.578449e-45 3.159087e-08 1.000000e+00 [109,] 1.221627e-36 5.811402e-05 9.999419e-01 [110,] 1.046280e-44 3.956327e-09 1.000000e+00 [111,] 1.775399e-27 9.010916e-03 9.909891e-01 [112,] 1.518738e-29 7.823942e-03 9.921761e-01 [113,] 2.041398e-34 6.231995e-05 9.999377e-01 [114,] 5.660664e-24 6.529490e-01 3.470510e-01 [115,] 7.166625e-27 4.895157e-02 9.510484e-01 [116,] 5.879819e-31 6.051577e-04 9.993948e-01 [117,] 1.789429e-31 9.501963e-04 9.990498e-01 [118,] 2.364301e-52 7.544743e-12 1.000000e+00 [119,] 7.542749e-57 4.302226e-12 1.000000e+00 [120,] 1.181638e-23 8.890101e-01 1.109899e-01 [121,] 4.869149e-38 2.102690e-06 9.999979e-01 [122,] 3.284881e-22 8.215690e-01 1.784310e-01 [123,] 1.223858e-52 7.611372e-11 1.000000e+00 [124,] 5.342028e-24 3.865481e-01 6.134519e-01 [125,] 6.054033e-36 1.127952e-05 9.999887e-01 [126,] 2.085175e-40 4.388139e-07 9.999996e-01 [127,] 1.763260e-22 6.698002e-01 3.301998e-01 [128,] 9.097872e-23 5.007794e-01 4.992206e-01 [129,] 4.988533e-34 1.984470e-04 9.998016e-01 [130,] 3.019952e-37 8.392597e-06 9.999916e-01 [131,] 1.422424e-43 8.290819e-08 9.999999e-01 [132,] 1.174192e-48 1.088190e-10 1.000000e+00 [133,] 1.508646e-34 1.239971e-04 9.998760e-01 [134,] 1.254623e-24 2.841190e-01 7.158810e-01 [135,] 2.771605e-29 2.548075e-02 9.745192e-01 [136,] 9.024027e-47 2.580492e-09 1.000000e+00 [137,] 2.490666e-34 3.296144e-05 9.999670e-01 [138,] 7.025706e-31 1.283507e-03 9.987165e-01 [139,] 1.751245e-21 7.873985e-01 2.126015e-01 [140,] 1.493664e-33 8.353069e-05 9.999165e-01 [141,] 1.420120e-36 8.621217e-06 9.999914e-01 [142,] 5.196881e-31 4.407646e-04 9.995592e-01 [143,] 1.355795e-24 3.827313e-01 6.172687e-01 [144,] 5.782379e-40 5.741210e-07 9.999994e-01 [145,] 5.062652e-38 1.718831e-06 9.999983e-01 [146,] 2.055977e-31 5.095741e-04 9.994904e-01 [147,] 7.527149e-26 1.785571e-01 8.214429e-01 [148,] 6.202938e-29 4.995365e-03 9.950046e-01 [149,] 5.809956e-31 4.638463e-04 9.995362e-01 [150,] 4.398339e-24 2.979812e-01 7.020188e-01 $loglik [1] -414.6980 $modelName [1] "EII" > ## Not run: > ##D do.call("estepEII", c(list(data=irisMatrix), msEst)) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "grid1" > > ### * grid1 > > flush(stderr()); flush(stdout()) > > ### Name: grid1 > ### Title: Generate grid points > ### Aliases: grid1 grid2 > ### Keywords: cluster > > ### ** Examples > > data(lansing) > maples <- lansing[as.character(lansing[,"species"]) == "maple", -3] > maplesBIC <- EMclust(maples) > maplesModel <- summary(maplesBIC, maples) > x <- grid1(100, range=c(0,1)) > y <- x > xyDens <- do.call("dens", c(list(data=grid2(x, y)), maplesModel)) > xyDens <- matrix(xyDens, ncol=100) > contour(xyDens) > points(maples, cex=.2, col="red") > > image(xyDens) > points(maples, cex=.5) > > > > cleanEx(); ..nameEx <- "hc" > > ### * hc > > flush(stderr()); flush(stdout()) > > ### Name: hc > ### Title: Model-based Hierarchical Clustering > ### Aliases: hc > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > hcTree <- hc(modelName = "VVV", data = irisMatrix) > cl <- hclass(hcTree,c(2,3)) > > par(pty = "s", mfrow = c(1,1)) > clPairs(irisMatrix,cl=cl[,"2"]) > clPairs(irisMatrix,cl=cl[,"3"]) > > par(mfrow = c(1,2)) > dimens <- c(1,2) > coordProj(irisMatrix, classification=cl[,"2"], dimens=dimens) Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > coordProj(irisMatrix, classification=cl[,"3"], dimens=dimens) Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "hcE" > > ### * hcE > > flush(stderr()); flush(stdout()) > > ### Name: hcE > ### Title: Model-based Hierarchical Clustering > ### Aliases: hcE hcV hcEII hcVII hcEEE hcVVV > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > hcTree <- hcEII(data = irisMatrix) > cl <- hclass(hcTree,c(2,3)) > > par(pty = "s", mfrow = c(1,1)) > clPairs(irisMatrix,cl=cl[,"2"]) > clPairs(irisMatrix,cl=cl[,"3"]) > > par(mfrow = c(1,2)) > dimens <- c(1,2) > coordProj(irisMatrix, classification=cl[,"2"], dimens=dimens) Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > coordProj(irisMatrix, classification=cl[,"3"], dimens=dimens) Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "hclass" > > ### * hclass > > flush(stderr()); flush(stdout()) > > ### Name: hclass > ### Title: Classifications from Hierarchical Agglomeration > ### Aliases: hclass > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- iris[,1:4] > > hcTree <- hc(modelName="VVV", data = irisMatrix) > cl <- hclass(hcTree,c(2,3)) > > par(pty = "s", mfrow = c(1,1)) > clPairs(irisMatrix,cl=cl[,"2"]) > clPairs(irisMatrix,cl=cl[,"3"]) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "hypvol" > > ### * hypvol > > flush(stderr()); flush(stdout()) > > ### Name: hypvol > ### Title: Aproximate Hypervolume for Multivariate Data > ### Aliases: hypvol > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > hypvol(irisMatrix) [1] 27.2412 > > > > cleanEx(); ..nameEx <- "lansing" > > ### * lansing > > flush(stderr()); flush(stdout()) > > ### Name: lansing > ### Title: Maple trees in Lansing Woods > ### Aliases: lansing > ### Keywords: datasets > > ### ** Examples > > data(lansing) > plot(lansing[,1:2], pch=as.integer(lansing[,3]), + col=as.integer(lansing[,3]), main="Lansing Woods tree types") > > > > cleanEx(); ..nameEx <- "map" > > ### * map > > flush(stderr()); flush(stdout()) > > ### Name: map > ### Title: Classification given Probabilities > ### Aliases: map > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > emEst <- me(modelName = "VVV", data = irisMatrix, z = unmap(irisClass)) > > map(emEst$z) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 3 2 3 2 [75] 2 2 2 3 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 [112] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 [149] 3 3 > > > > cleanEx(); ..nameEx <- "mapClass" > > ### * mapClass > > flush(stderr()); flush(stdout()) > > ### Name: mapClass > ### Title: Correspondence between classifications. > ### Aliases: mapClass > ### Keywords: cluster > > ### ** Examples > > a <- rep(1:3, 3) > a [1] 1 2 3 1 2 3 1 2 3 > b <- rep(c("A", "B", "C"), 3) > b [1] "A" "B" "C" "A" "B" "C" "A" "B" "C" > mapClass(a, b) $aTOb $aTOb$"1" [1] "A" $aTOb$"2" [1] "B" $aTOb$"3" [1] "C" $bTOa $bTOa$A [1] 1 $bTOa$B [1] 2 $bTOa$C [1] 3 > a <- sample(1:3, 9, replace = TRUE) > a [1] 1 2 2 3 1 3 3 2 2 > b <- sample(c("A", "B", "C"), 9, replace = TRUE) > b [1] "A" "A" "A" "C" "B" "C" "B" "C" "C" > mapClass(a, b) $aTOb $aTOb$"1" [1] "A" $aTOb$"2" [1] "A" $aTOb$"3" [1] "C" $bTOa $bTOa$A [1] 2 $bTOa$B [1] 1 $bTOa$C [1] 2 > > > > cleanEx(); ..nameEx <- "mclust1Dplot" > > ### * mclust1Dplot > > flush(stderr()); flush(stdout()) > > ### Name: mclust1Dplot > ### Title: Plot one-dimensional data modelled by an MVN mixture. > ### Aliases: mclust1Dplot > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > y <- c(rnorm(n,-5), rnorm(n,0), rnorm(n,5)) > yclass <- c(rep(1,n), rep(2,n), rep(3,n)) > > yEMclust <- summary(EMclust(y),y) > > mclust1Dplot(y, identify = TRUE, truth = yclass, z = yEMclust$z, ask=FALSE, + mu = yEMclust$mu, sigma = yEMclust$sigma, pro = yEMclust$pro) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function > > do.call("mclust1Dplot", + c(list(data = y, identify = TRUE, truth = yclass, ask=FALSE), + yEMclust)) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigmasq" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function > > > > cleanEx(); ..nameEx <- "mclust2Dplot" > > ### * mclust2Dplot > > flush(stderr()); flush(stdout()) > > ### Name: mclust2Dplot > ### Title: Plot two-dimensional data modelled by an MVN mixture. > ### Aliases: mclust2Dplot > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > > xEMclust <- summary(EMclust(x),x) > > mclust2Dplot(x, truth = xclass, z = xEMclust$z, ask=FALSE, + mu = xEMclust$mu, sigma = xEMclust$sigma) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function > > do.call("mclust2Dplot", c(list(data = x, truth = xclass, ask=FALSE), xEMclust)) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "bic" could not be set in high-level plot() function Warning: parameter "options" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "uncertainty" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "z" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "decomp" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "loglik" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function > > > > > cleanEx(); ..nameEx <- "mclustDA" > > ### * mclustDA > > flush(stderr()); flush(stdout()) > > ### Name: mclustDA > ### Title: MclustDA discriminant analysis. > ### Aliases: mclustDA print.mclustDA > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > > ## Not run: > ##D par(pty = "s") > ##D mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE) > ## End(Not run) > > odd <- seq(from = 1, to = 2*n, by = 2) > even <- odd + 1 > testMclustDA <- mclustDA(trainingData = x[odd, ], labels = xclass[odd], + testData = x[even,]) > > clEven <- testMclustDA$testClassification ## classify training set > compareClass(clEven,xclass[even]) [1] 0.06952664 > ## Not run: > ##D plot(testMclustDA, trainingData = x[odd, ], labels = xclass[odd], > ##D testData = x[even,]) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "mclustDAtest" > > ### * mclustDAtest > > flush(stderr()); flush(stdout()) > > ### Name: mclustDAtest > ### Title: MclustDA Testing > ### Aliases: mclustDAtest > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > ## Not run: > ##D par(pty = "s") > ##D mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE) > ## End(Not run) > > odd <- seq(1, 2*n, 2) > train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step XXX XXX 1 1 > summary(train) $"1" $"1"$model [1] "XXX,1" $"1"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [112] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $"2" $"2"$model [1] "XXX,1" $"2"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [112] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > > even <- odd + 1 > test <- mclustDAtest(x[even, ], train) ## compute model densities > summary(test)$class ## classify training set [1] "1" "1" "2" "1" "2" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [19] "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [37] "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "2" "1" "1" "1" "1" "1" "1" "1" [55] "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [73] "1" "1" "2" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [91] "1" "1" "1" "1" "2" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [109] "1" "2" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "2" "1" "1" "2" [127] "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" [145] "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" [163] "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" [181] "2" "2" "2" "2" "1" "2" "2" "2" "2" "2" "1" "2" "2" "2" "2" "2" "2" "2" [199] "2" "2" "2" "1" "2" "2" "2" "2" "2" "2" "2" "1" "2" "2" "2" "2" "2" "2" [217] "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" [235] "2" "2" "2" "2" "1" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" > > > > cleanEx(); ..nameEx <- "mclustDAtrain" > > ### * mclustDAtrain > > flush(stderr()); flush(stdout()) > > ### Name: mclustDAtrain > ### Title: MclustDA Training > ### Aliases: mclustDAtrain > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > par(pty = "s") > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > ## Not run: > ##D mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE) > ## End(Not run) > > odd <- seq(1, 2*n, 2) > train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step XXX XXX 1 1 > summary(train) $"1" $"1"$model [1] "XXX,1" $"1"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [112] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $"2" $"2"$model [1] "XXX,1" $"2"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [112] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 > > even <- odd + 1 > test <- mclustDAtest(x[even, ], train) ## compute model densities > clEven <- summary(test)$class ## classify training set > compareClass(clEven,xclass[even]) [1] 0.06952664 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "mclustOptions" > > ### * mclustOptions > > flush(stderr()); flush(stdout()) > > ### Name: mclustOptions > ### Title: Set control values for use with MCLUST. > ### Aliases: mclustOptions > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > .Mclust $eps [1] 2.220446e-16 $tol [1] 1e-05 1e-05 $itmax [1] Inf Inf $equalPro [1] FALSE $warnSingular [1] TRUE $emModelNames [1] "EII" "VII" "EEI" "VEI" "EVI" "VVI" "EEE" "EEV" "VEV" "VVV" $hcModelName [1] "E" "VVV" $symbols [1] 17 0 10 4 11 18 6 7 3 16 2 12 8 15 1 9 14 13 5 > .Mclust <- mclustOptions(tol = 1.e-6, emModelNames = c("VII", "VVI", "VVV")) > .Mclust $tol [1] 1e-06 $eps [1] 2.220446e-16 $itmax [1] Inf Inf $equalPro [1] FALSE $emModelNames [1] "VII" "VVI" "VVV" $hcModelName [1] "V" "VVV" $warnSingular [1] TRUE $symbols [1] 17 0 10 4 11 18 6 7 3 16 2 12 8 15 1 9 14 13 5 > irisBic <- EMclust(irisMatrix) > summary(irisBic, irisMatrix) classification table: 1 2 50 100 uncertainty (quartiles): 0% 25% 50% 75% 100% 0.000000e+00 0.000000e+00 0.000000e+00 6.585066e-12 6.278349e-04 best BIC values: VVV,2 VVV,3 VII,9 -574.0178 -580.8390 -703.3339 best model: ellipsoidal, unconstrained > .Mclust <- mclustOptions() # restore default values > .Mclust $tol [1] 1e-05 1e-05 $eps [1] 2.220446e-16 $itmax [1] Inf Inf $equalPro [1] FALSE $emModelNames [1] "EII" "VII" "EEI" "VEI" "EVI" "VVI" "EEE" "EEV" "VEV" "VVV" $hcModelName [1] "V" "VVV" $warnSingular [1] TRUE $symbols [1] 17 0 10 4 11 18 6 7 3 16 2 12 8 15 1 9 14 13 5 > > > > cleanEx(); ..nameEx <- "me" > > ### * me > > flush(stderr()); flush(stdout()) > > ### Name: me > ### Title: EM algorithm starting with M-step for parameterized MVN mixture > ### models. > ### Aliases: me > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > me(modelName = "VVV", data = irisMatrix, z = unmap(irisClass)) $n [1] 150 $d [1] 4 $G [1] 3 $z setosa versicolor virginica [1,] 1.000000e+00 1.340380e-44 1.861339e-34 [2,] 1.000000e+00 2.201405e-31 6.676298e-28 [3,] 1.000000e+00 1.896748e-36 1.102178e-29 [4,] 1.000000e+00 3.488647e-32 6.409600e-26 [5,] 1.000000e+00 4.393475e-47 7.745885e-35 [6,] 1.000000e+00 1.278514e-45 9.141846e-35 [7,] 1.000000e+00 1.725033e-36 1.528128e-28 [8,] 1.000000e+00 1.013323e-40 1.687173e-31 [9,] 1.000000e+00 6.118503e-28 6.204452e-24 [10,] 1.000000e+00 3.941874e-36 2.494386e-28 [11,] 1.000000e+00 4.448705e-50 1.929162e-37 [12,] 1.000000e+00 3.292550e-39 7.578657e-29 [13,] 1.000000e+00 2.565267e-34 5.452124e-28 [14,] 1.000000e+00 9.106612e-35 1.909555e-27 [15,] 1.000000e+00 3.125165e-63 1.593148e-47 [16,] 1.000000e+00 1.896077e-64 4.876149e-46 [17,] 1.000000e+00 5.596191e-50 1.021588e-39 [18,] 1.000000e+00 6.308031e-41 2.149597e-33 [19,] 1.000000e+00 2.370660e-47 1.329559e-36 [20,] 1.000000e+00 4.052147e-48 1.898553e-35 [21,] 1.000000e+00 3.784797e-39 8.212299e-31 [22,] 1.000000e+00 2.257628e-41 6.202577e-33 [23,] 1.000000e+00 6.419874e-48 7.020340e-35 [24,] 1.000000e+00 6.639759e-26 1.443374e-24 [25,] 1.000000e+00 7.175865e-36 2.846195e-24 [26,] 1.000000e+00 1.227836e-29 6.692266e-26 [27,] 1.000000e+00 1.658055e-32 6.789689e-28 [28,] 1.000000e+00 6.872462e-44 7.516822e-34 [29,] 1.000000e+00 4.516919e-42 6.057310e-34 [30,] 1.000000e+00 6.438483e-34 2.970895e-26 [31,] 1.000000e+00 9.491263e-32 6.566490e-26 [32,] 1.000000e+00 1.359677e-34 1.377621e-31 [33,] 1.000000e+00 1.807081e-66 1.923514e-41 [34,] 1.000000e+00 2.640245e-67 1.082266e-45 [35,] 1.000000e+00 6.866910e-33 9.278292e-28 [36,] 1.000000e+00 5.302053e-38 1.312420e-32 [37,] 1.000000e+00 3.083368e-46 5.787644e-38 [38,] 1.000000e+00 1.102357e-50 7.771785e-35 [39,] 1.000000e+00 8.786404e-31 1.026566e-25 [40,] 1.000000e+00 6.077402e-41 4.042171e-32 [41,] 1.000000e+00 1.877063e-41 1.037298e-33 [42,] 1.000000e+00 3.904478e-15 2.495765e-19 [43,] 1.000000e+00 2.822962e-35 2.367557e-27 [44,] 1.000000e+00 1.608040e-27 5.055302e-25 [45,] 1.000000e+00 3.082923e-39 2.560673e-28 [46,] 1.000000e+00 4.000241e-28 2.471836e-26 [47,] 1.000000e+00 2.987492e-51 3.564570e-35 [48,] 1.000000e+00 2.344766e-35 6.084895e-28 [49,] 1.000000e+00 7.194407e-50 8.191014e-37 [50,] 1.000000e+00 5.327318e-39 1.230925e-31 [51,] 3.032539e-92 9.997227e-01 2.773164e-04 [52,] 1.150038e-83 9.986288e-01 1.371182e-03 [53,] 1.797174e-104 9.944941e-01 5.505859e-03 [54,] 1.115012e-63 9.320826e-01 6.791742e-02 [55,] 4.881945e-92 9.705411e-01 2.945894e-02 [56,] 2.954459e-79 9.685784e-01 3.142162e-02 [57,] 8.550867e-94 9.865626e-01 1.343744e-02 [58,] 3.765759e-34 9.998441e-01 1.558591e-04 [59,] 1.336478e-86 9.986175e-01 1.382503e-03 [60,] 1.747387e-60 9.669572e-01 3.304278e-02 [61,] 3.021885e-42 9.982058e-01 1.794178e-03 [62,] 1.635100e-72 9.927992e-01 7.200848e-03 [63,] 4.079064e-61 9.991369e-01 8.630789e-04 [64,] 1.012713e-90 9.670966e-01 3.290342e-02 [65,] 7.559543e-47 9.997995e-01 2.005120e-04 [66,] 3.050597e-79 9.998767e-01 1.232632e-04 [67,] 1.489175e-83 9.246757e-01 7.532431e-02 [68,] 8.933659e-58 9.965960e-01 3.404046e-03 [69,] 3.934648e-92 2.925580e-03 9.970744e-01 [70,] 7.242827e-55 9.995024e-01 4.975685e-04 [71,] 7.707744e-106 5.397566e-02 9.460243e-01 [72,] 3.850909e-62 9.998443e-01 1.556841e-04 [73,] 4.713812e-107 4.325311e-02 9.567469e-01 [74,] 3.438056e-86 9.136402e-01 8.635976e-02 [75,] 1.817276e-73 9.997824e-01 2.176209e-04 [76,] 6.615926e-80 9.997244e-01 2.755883e-04 [77,] 3.767869e-100 9.879246e-01 1.207544e-02 [78,] 1.254096e-114 3.361880e-01 6.638120e-01 [79,] 4.845433e-85 9.646654e-01 3.533460e-02 [80,] 2.507098e-39 9.999864e-01 1.363479e-05 [81,] 3.878089e-52 9.995100e-01 4.900484e-04 [82,] 8.943244e-47 9.998196e-01 1.803552e-04 [83,] 4.112093e-56 9.998282e-01 1.717912e-04 [84,] 1.761949e-116 6.973648e-03 9.930264e-01 [85,] 1.873570e-83 8.494274e-01 1.505726e-01 [86,] 4.330051e-84 9.873428e-01 1.265717e-02 [87,] 1.827651e-94 9.975530e-01 2.447044e-03 [88,] 2.149510e-82 9.204475e-01 7.955247e-02 [89,] 1.777598e-62 9.985437e-01 1.456316e-03 [90,] 1.223594e-62 9.899298e-01 1.007019e-02 [91,] 1.057937e-73 9.412283e-01 5.877173e-02 [92,] 1.119977e-85 9.910150e-01 8.985033e-03 [93,] 1.917546e-60 9.995110e-01 4.889726e-04 [94,] 5.809300e-35 9.998832e-01 1.168043e-04 [95,] 1.439348e-68 9.937569e-01 6.243104e-03 [96,] 4.058872e-63 9.973306e-01 2.669419e-03 [97,] 3.805944e-67 9.979620e-01 2.037953e-03 [98,] 1.658725e-72 9.994971e-01 5.028802e-04 [99,] 3.308948e-28 9.999418e-01 5.818736e-05 [100,] 1.884676e-64 9.986048e-01 1.395245e-03 [101,] 3.010949e-203 5.530199e-17 1.000000e+00 [102,] 1.753436e-128 1.077534e-07 9.999999e-01 [103,] 3.185553e-181 2.653929e-09 1.000000e+00 [104,] 1.348868e-148 4.312002e-05 9.999569e-01 [105,] 9.131952e-178 7.830553e-12 1.000000e+00 [106,] 1.376312e-228 2.727688e-11 1.000000e+00 [107,] 3.275601e-95 1.168041e-05 9.999883e-01 [108,] 1.485822e-196 1.996513e-07 9.999998e-01 [109,] 1.096470e-166 5.615666e-09 1.000000e+00 [110,] 1.838986e-207 5.153929e-13 1.000000e+00 [111,] 1.407473e-129 6.017637e-05 9.999398e-01 [112,] 7.916908e-140 1.650636e-07 9.999998e-01 [113,] 9.136916e-158 5.957065e-09 1.000000e+00 [114,] 1.956477e-130 2.233857e-12 1.000000e+00 [115,] 2.022253e-156 3.404704e-22 1.000000e+00 [116,] 9.392240e-156 1.026315e-12 1.000000e+00 [117,] 6.602144e-143 7.801735e-04 9.992198e-01 [118,] 2.748870e-228 5.421043e-06 9.999946e-01 [119,] 7.429637e-265 3.265440e-22 1.000000e+00 [120,] 1.370738e-113 5.282640e-05 9.999472e-01 [121,] 4.351788e-177 4.577282e-12 1.000000e+00 [122,] 1.054301e-123 3.279642e-09 1.000000e+00 [123,] 1.162139e-235 1.885723e-12 1.000000e+00 [124,] 6.201270e-116 5.216528e-05 9.999478e-01 [125,] 1.891890e-164 2.001713e-06 9.999980e-01 [126,] 1.323823e-172 7.420387e-04 9.992580e-01 [127,] 4.617100e-110 3.526679e-04 9.996473e-01 [128,] 2.794272e-112 5.946968e-03 9.940530e-01 [129,] 1.280855e-163 1.922717e-11 1.000000e+00 [130,] 3.061896e-157 4.726577e-03 9.952734e-01 [131,] 6.533587e-190 3.218376e-08 1.000000e+00 [132,] 4.771065e-201 6.006480e-03 9.939935e-01 [133,] 6.908783e-169 3.468057e-14 1.000000e+00 [134,] 2.744809e-113 2.199157e-01 7.800843e-01 [135,] 3.663047e-138 3.079362e-05 9.999692e-01 [136,] 2.609736e-207 1.978334e-14 1.000000e+00 [137,] 7.627542e-175 3.636807e-13 1.000000e+00 [138,] 2.136992e-141 2.459565e-03 9.975404e-01 [139,] 1.018504e-107 5.760480e-03 9.942395e-01 [140,] 8.410204e-152 7.863015e-08 9.999999e-01 [141,] 2.436458e-178 1.184065e-16 1.000000e+00 [142,] 2.086983e-148 3.695558e-14 1.000000e+00 [143,] 1.753436e-128 1.077534e-07 9.999999e-01 [144,] 1.276099e-187 4.205111e-12 1.000000e+00 [145,] 9.196112e-188 2.313054e-17 1.000000e+00 [146,] 1.126391e-153 3.179633e-15 1.000000e+00 [147,] 3.395534e-127 2.310806e-09 1.000000e+00 [148,] 1.300448e-136 1.192490e-06 9.999988e-01 [149,] 1.141901e-158 1.374617e-10 1.000000e+00 [150,] 2.488135e-121 1.722216e-03 9.982778e-01 $mu 1 2 3 [1,] 5.006 5.915306 6.544949 [2,] 3.428 2.777875 2.948818 [3,] 1.462 4.202227 5.480372 [4,] 0.246 1.297229 1.985127 $sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.121764 0.097232 0.016028 0.010124 [2,] 0.097232 0.140816 0.011464 0.009112 [3,] 0.016028 0.011464 0.029556 0.005948 [4,] 0.010124 0.009112 0.005948 0.010884 , , 2 [,1] [,2] [,3] [,4] [1,] 0.27533588 0.09687192 0.18477153 0.05444692 [2,] 0.09687192 0.09262785 0.09111654 0.04299505 [3,] 0.18477153 0.09111654 0.20089896 0.06109388 [4,] 0.05444692 0.04299505 0.06109388 0.03205203 , , 3 [,1] [,2] [,3] [,4] [1,] 0.38707068 0.09220736 0.30268373 0.06147257 [2,] 0.09220736 0.11034902 0.08419484 0.05595573 [3,] 0.30268373 0.08419484 0.32736949 0.07416052 [4,] 0.06147257 0.05595573 0.07416052 0.08559833 $cholsigma , , 1 [,1] [,2] [,3] [,4] [1,] -0.348947 -0.2786440 -0.045932479 -0.029013003 [2,] 0.000000 0.2513434 -0.005310709 0.004088826 [3,] 0.000000 0.0000000 -0.165583827 -0.028004398 [4,] 0.000000 0.0000000 0.000000000 0.096131581 , , 2 [,1] [,2] [,3] [,4] [1,] 0.5247246 0.1846148 0.3521305 0.10376286 [2,] 0.0000000 -0.2419612 -0.1079018 -0.09852359 [3,] 0.0000000 0.0000000 0.2554609 0.05450909 [4,] 0.0000000 0.0000000 0.0000000 -0.09277479 , , 3 [,1] [,2] [,3] [,4] [1,] -0.62215 -0.1482076 -0.48651244 -0.09880666 [2,] 0.00000 -0.2972937 -0.04066688 -0.13895968 [3,] 0.00000 0.0000000 -0.29836444 -0.06850276 [4,] 0.00000 0.0000000 0.00000000 -0.22766895 attr(,"def") [1] "Sigma = t(cholsigma) %*% cholsigma" $pro [1] 0.3333333 0.2995864 0.3670803 $loglik [1] -180.1859 $Vinv NULL $modelName [1] "VVV" attr(,"info") iterations error 1.100000e+01 4.438788e-06 > > > > cleanEx(); ..nameEx <- "meE" > > ### * meE > > flush(stderr()); flush(stdout()) > > ### Name: meE > ### Title: EM algorithm starting with M-step for a parameterized MVN > ### mixture model. > ### Aliases: meE meV meEII meVII meEEI meVEI meEVI meVVI meEEE meEEV meVEV > ### meVVV > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > meVVV(data = irisMatrix, z = unmap(irisClass)) $n [1] 150 $d [1] 4 $G [1] 3 $z setosa versicolor virginica [1,] 1.000000e+00 1.340380e-44 1.861339e-34 [2,] 1.000000e+00 2.201405e-31 6.676298e-28 [3,] 1.000000e+00 1.896748e-36 1.102178e-29 [4,] 1.000000e+00 3.488647e-32 6.409600e-26 [5,] 1.000000e+00 4.393475e-47 7.745885e-35 [6,] 1.000000e+00 1.278514e-45 9.141846e-35 [7,] 1.000000e+00 1.725033e-36 1.528128e-28 [8,] 1.000000e+00 1.013323e-40 1.687173e-31 [9,] 1.000000e+00 6.118503e-28 6.204452e-24 [10,] 1.000000e+00 3.941874e-36 2.494386e-28 [11,] 1.000000e+00 4.448705e-50 1.929162e-37 [12,] 1.000000e+00 3.292550e-39 7.578657e-29 [13,] 1.000000e+00 2.565267e-34 5.452124e-28 [14,] 1.000000e+00 9.106612e-35 1.909555e-27 [15,] 1.000000e+00 3.125165e-63 1.593148e-47 [16,] 1.000000e+00 1.896077e-64 4.876149e-46 [17,] 1.000000e+00 5.596191e-50 1.021588e-39 [18,] 1.000000e+00 6.308031e-41 2.149597e-33 [19,] 1.000000e+00 2.370660e-47 1.329559e-36 [20,] 1.000000e+00 4.052147e-48 1.898553e-35 [21,] 1.000000e+00 3.784797e-39 8.212299e-31 [22,] 1.000000e+00 2.257628e-41 6.202577e-33 [23,] 1.000000e+00 6.419874e-48 7.020340e-35 [24,] 1.000000e+00 6.639759e-26 1.443374e-24 [25,] 1.000000e+00 7.175865e-36 2.846195e-24 [26,] 1.000000e+00 1.227836e-29 6.692266e-26 [27,] 1.000000e+00 1.658055e-32 6.789689e-28 [28,] 1.000000e+00 6.872462e-44 7.516822e-34 [29,] 1.000000e+00 4.516919e-42 6.057310e-34 [30,] 1.000000e+00 6.438483e-34 2.970895e-26 [31,] 1.000000e+00 9.491263e-32 6.566490e-26 [32,] 1.000000e+00 1.359677e-34 1.377621e-31 [33,] 1.000000e+00 1.807081e-66 1.923514e-41 [34,] 1.000000e+00 2.640245e-67 1.082266e-45 [35,] 1.000000e+00 6.866910e-33 9.278292e-28 [36,] 1.000000e+00 5.302053e-38 1.312420e-32 [37,] 1.000000e+00 3.083368e-46 5.787644e-38 [38,] 1.000000e+00 1.102357e-50 7.771785e-35 [39,] 1.000000e+00 8.786404e-31 1.026566e-25 [40,] 1.000000e+00 6.077402e-41 4.042171e-32 [41,] 1.000000e+00 1.877063e-41 1.037298e-33 [42,] 1.000000e+00 3.904478e-15 2.495765e-19 [43,] 1.000000e+00 2.822962e-35 2.367557e-27 [44,] 1.000000e+00 1.608040e-27 5.055302e-25 [45,] 1.000000e+00 3.082923e-39 2.560673e-28 [46,] 1.000000e+00 4.000241e-28 2.471836e-26 [47,] 1.000000e+00 2.987492e-51 3.564570e-35 [48,] 1.000000e+00 2.344766e-35 6.084895e-28 [49,] 1.000000e+00 7.194407e-50 8.191014e-37 [50,] 1.000000e+00 5.327318e-39 1.230925e-31 [51,] 3.032539e-92 9.997227e-01 2.773164e-04 [52,] 1.150038e-83 9.986288e-01 1.371182e-03 [53,] 1.797174e-104 9.944941e-01 5.505859e-03 [54,] 1.115012e-63 9.320826e-01 6.791742e-02 [55,] 4.881945e-92 9.705411e-01 2.945894e-02 [56,] 2.954459e-79 9.685784e-01 3.142162e-02 [57,] 8.550867e-94 9.865626e-01 1.343744e-02 [58,] 3.765759e-34 9.998441e-01 1.558591e-04 [59,] 1.336478e-86 9.986175e-01 1.382503e-03 [60,] 1.747387e-60 9.669572e-01 3.304278e-02 [61,] 3.021885e-42 9.982058e-01 1.794178e-03 [62,] 1.635100e-72 9.927992e-01 7.200848e-03 [63,] 4.079064e-61 9.991369e-01 8.630789e-04 [64,] 1.012713e-90 9.670966e-01 3.290342e-02 [65,] 7.559543e-47 9.997995e-01 2.005120e-04 [66,] 3.050597e-79 9.998767e-01 1.232632e-04 [67,] 1.489175e-83 9.246757e-01 7.532431e-02 [68,] 8.933659e-58 9.965960e-01 3.404046e-03 [69,] 3.934648e-92 2.925580e-03 9.970744e-01 [70,] 7.242827e-55 9.995024e-01 4.975685e-04 [71,] 7.707744e-106 5.397566e-02 9.460243e-01 [72,] 3.850909e-62 9.998443e-01 1.556841e-04 [73,] 4.713812e-107 4.325311e-02 9.567469e-01 [74,] 3.438056e-86 9.136402e-01 8.635976e-02 [75,] 1.817276e-73 9.997824e-01 2.176209e-04 [76,] 6.615926e-80 9.997244e-01 2.755883e-04 [77,] 3.767869e-100 9.879246e-01 1.207544e-02 [78,] 1.254096e-114 3.361880e-01 6.638120e-01 [79,] 4.845433e-85 9.646654e-01 3.533460e-02 [80,] 2.507098e-39 9.999864e-01 1.363479e-05 [81,] 3.878089e-52 9.995100e-01 4.900484e-04 [82,] 8.943244e-47 9.998196e-01 1.803552e-04 [83,] 4.112093e-56 9.998282e-01 1.717912e-04 [84,] 1.761949e-116 6.973648e-03 9.930264e-01 [85,] 1.873570e-83 8.494274e-01 1.505726e-01 [86,] 4.330051e-84 9.873428e-01 1.265717e-02 [87,] 1.827651e-94 9.975530e-01 2.447044e-03 [88,] 2.149510e-82 9.204475e-01 7.955247e-02 [89,] 1.777598e-62 9.985437e-01 1.456316e-03 [90,] 1.223594e-62 9.899298e-01 1.007019e-02 [91,] 1.057937e-73 9.412283e-01 5.877173e-02 [92,] 1.119977e-85 9.910150e-01 8.985033e-03 [93,] 1.917546e-60 9.995110e-01 4.889726e-04 [94,] 5.809300e-35 9.998832e-01 1.168043e-04 [95,] 1.439348e-68 9.937569e-01 6.243104e-03 [96,] 4.058872e-63 9.973306e-01 2.669419e-03 [97,] 3.805944e-67 9.979620e-01 2.037953e-03 [98,] 1.658725e-72 9.994971e-01 5.028802e-04 [99,] 3.308948e-28 9.999418e-01 5.818736e-05 [100,] 1.884676e-64 9.986048e-01 1.395245e-03 [101,] 3.010949e-203 5.530199e-17 1.000000e+00 [102,] 1.753436e-128 1.077534e-07 9.999999e-01 [103,] 3.185553e-181 2.653929e-09 1.000000e+00 [104,] 1.348868e-148 4.312002e-05 9.999569e-01 [105,] 9.131952e-178 7.830553e-12 1.000000e+00 [106,] 1.376312e-228 2.727688e-11 1.000000e+00 [107,] 3.275601e-95 1.168041e-05 9.999883e-01 [108,] 1.485822e-196 1.996513e-07 9.999998e-01 [109,] 1.096470e-166 5.615666e-09 1.000000e+00 [110,] 1.838986e-207 5.153929e-13 1.000000e+00 [111,] 1.407473e-129 6.017637e-05 9.999398e-01 [112,] 7.916908e-140 1.650636e-07 9.999998e-01 [113,] 9.136916e-158 5.957065e-09 1.000000e+00 [114,] 1.956477e-130 2.233857e-12 1.000000e+00 [115,] 2.022253e-156 3.404704e-22 1.000000e+00 [116,] 9.392240e-156 1.026315e-12 1.000000e+00 [117,] 6.602144e-143 7.801735e-04 9.992198e-01 [118,] 2.748870e-228 5.421043e-06 9.999946e-01 [119,] 7.429637e-265 3.265440e-22 1.000000e+00 [120,] 1.370738e-113 5.282640e-05 9.999472e-01 [121,] 4.351788e-177 4.577282e-12 1.000000e+00 [122,] 1.054301e-123 3.279642e-09 1.000000e+00 [123,] 1.162139e-235 1.885723e-12 1.000000e+00 [124,] 6.201270e-116 5.216528e-05 9.999478e-01 [125,] 1.891890e-164 2.001713e-06 9.999980e-01 [126,] 1.323823e-172 7.420387e-04 9.992580e-01 [127,] 4.617100e-110 3.526679e-04 9.996473e-01 [128,] 2.794272e-112 5.946968e-03 9.940530e-01 [129,] 1.280855e-163 1.922717e-11 1.000000e+00 [130,] 3.061896e-157 4.726577e-03 9.952734e-01 [131,] 6.533587e-190 3.218376e-08 1.000000e+00 [132,] 4.771065e-201 6.006480e-03 9.939935e-01 [133,] 6.908783e-169 3.468057e-14 1.000000e+00 [134,] 2.744809e-113 2.199157e-01 7.800843e-01 [135,] 3.663047e-138 3.079362e-05 9.999692e-01 [136,] 2.609736e-207 1.978334e-14 1.000000e+00 [137,] 7.627542e-175 3.636807e-13 1.000000e+00 [138,] 2.136992e-141 2.459565e-03 9.975404e-01 [139,] 1.018504e-107 5.760480e-03 9.942395e-01 [140,] 8.410204e-152 7.863015e-08 9.999999e-01 [141,] 2.436458e-178 1.184065e-16 1.000000e+00 [142,] 2.086983e-148 3.695558e-14 1.000000e+00 [143,] 1.753436e-128 1.077534e-07 9.999999e-01 [144,] 1.276099e-187 4.205111e-12 1.000000e+00 [145,] 9.196112e-188 2.313054e-17 1.000000e+00 [146,] 1.126391e-153 3.179633e-15 1.000000e+00 [147,] 3.395534e-127 2.310806e-09 1.000000e+00 [148,] 1.300448e-136 1.192490e-06 9.999988e-01 [149,] 1.141901e-158 1.374617e-10 1.000000e+00 [150,] 2.488135e-121 1.722216e-03 9.982778e-01 $mu 1 2 3 [1,] 5.006 5.915306 6.544949 [2,] 3.428 2.777875 2.948818 [3,] 1.462 4.202227 5.480372 [4,] 0.246 1.297229 1.985127 $sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.121764 0.097232 0.016028 0.010124 [2,] 0.097232 0.140816 0.011464 0.009112 [3,] 0.016028 0.011464 0.029556 0.005948 [4,] 0.010124 0.009112 0.005948 0.010884 , , 2 [,1] [,2] [,3] [,4] [1,] 0.27533588 0.09687192 0.18477153 0.05444692 [2,] 0.09687192 0.09262785 0.09111654 0.04299505 [3,] 0.18477153 0.09111654 0.20089896 0.06109388 [4,] 0.05444692 0.04299505 0.06109388 0.03205203 , , 3 [,1] [,2] [,3] [,4] [1,] 0.38707068 0.09220736 0.30268373 0.06147257 [2,] 0.09220736 0.11034902 0.08419484 0.05595573 [3,] 0.30268373 0.08419484 0.32736949 0.07416052 [4,] 0.06147257 0.05595573 0.07416052 0.08559833 $cholsigma , , 1 [,1] [,2] [,3] [,4] [1,] -0.348947 -0.2786440 -0.045932479 -0.029013003 [2,] 0.000000 0.2513434 -0.005310709 0.004088826 [3,] 0.000000 0.0000000 -0.165583827 -0.028004398 [4,] 0.000000 0.0000000 0.000000000 0.096131581 , , 2 [,1] [,2] [,3] [,4] [1,] 0.5247246 0.1846148 0.3521305 0.10376286 [2,] 0.0000000 -0.2419612 -0.1079018 -0.09852359 [3,] 0.0000000 0.0000000 0.2554609 0.05450909 [4,] 0.0000000 0.0000000 0.0000000 -0.09277479 , , 3 [,1] [,2] [,3] [,4] [1,] -0.62215 -0.1482076 -0.48651244 -0.09880666 [2,] 0.00000 -0.2972937 -0.04066688 -0.13895968 [3,] 0.00000 0.0000000 -0.29836444 -0.06850276 [4,] 0.00000 0.0000000 0.00000000 -0.22766895 attr(,"def") [1] "Sigma = t(cholsigma) %*% cholsigma" $pro [1] 0.3333333 0.2995864 0.3670803 $loglik [1] -180.1859 $Vinv NULL $modelName [1] "VVV" attr(,"info") iterations error 1.100000e+01 4.438788e-06 > > > > cleanEx(); ..nameEx <- "mstep" > > ### * mstep > > flush(stderr()); flush(stdout()) > > ### Name: mstep > ### Title: M-step in the EM algorithm for parameterized MVN mixture models. > ### Aliases: mstep > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > mstep(modelName = "VII", data = irisMatrix, z = unmap(irisClass)) $n [1] 150 $d [1] 4 $G [1] 3 $mu 1 2 3 [1,] 5.006 5.936 6.588 [2,] 3.428 2.770 2.974 [3,] 1.462 4.260 5.552 [4,] 0.246 1.326 2.026 $sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.075755 0.000000 0.000000 0.000000 [2,] 0.000000 0.075755 0.000000 0.000000 [3,] 0.000000 0.000000 0.075755 0.000000 [4,] 0.000000 0.000000 0.000000 0.075755 , , 2 [,1] [,2] [,3] [,4] [1,] 0.153082 0.000000 0.000000 0.000000 [2,] 0.000000 0.153082 0.000000 0.000000 [3,] 0.000000 0.000000 0.153082 0.000000 [4,] 0.000000 0.000000 0.000000 0.153082 , , 3 [,1] [,2] [,3] [,4] [1,] 0.21765 0.00000 0.00000 0.00000 [2,] 0.00000 0.21765 0.00000 0.00000 [3,] 0.00000 0.00000 0.21765 0.00000 [4,] 0.00000 0.00000 0.00000 0.21765 $sigmasq [1] 0.075755 0.153082 0.217650 $decomp $decomp$d [1] 4 $decomp$G [1] 3 $decomp$scale [1] 0.075755 0.153082 0.217650 $pro [1] 0.3333333 0.3333333 0.3333333 $modelName [1] "VII" > > > > cleanEx(); ..nameEx <- "mstepE" > > ### * mstepE > > flush(stderr()); flush(stdout()) > > ### Name: mstepE > ### Title: M-step in the EM algorithm for a parameterized MVN mixture > ### model. > ### Aliases: mstepE mstepV mstepEII mstepVII mstepEEI mstepVEI mstepEVI > ### mstepVVI mstepEEE mstepEEV mstepVEV mstepVVV > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > mstepVII(data = irisMatrix, z = unmap(irisClass)) $n [1] 150 $d [1] 4 $G [1] 3 $mu 1 2 3 [1,] 5.006 5.936 6.588 [2,] 3.428 2.770 2.974 [3,] 1.462 4.260 5.552 [4,] 0.246 1.326 2.026 $sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.075755 0.000000 0.000000 0.000000 [2,] 0.000000 0.075755 0.000000 0.000000 [3,] 0.000000 0.000000 0.075755 0.000000 [4,] 0.000000 0.000000 0.000000 0.075755 , , 2 [,1] [,2] [,3] [,4] [1,] 0.153082 0.000000 0.000000 0.000000 [2,] 0.000000 0.153082 0.000000 0.000000 [3,] 0.000000 0.000000 0.153082 0.000000 [4,] 0.000000 0.000000 0.000000 0.153082 , , 3 [,1] [,2] [,3] [,4] [1,] 0.21765 0.00000 0.00000 0.00000 [2,] 0.00000 0.21765 0.00000 0.00000 [3,] 0.00000 0.00000 0.21765 0.00000 [4,] 0.00000 0.00000 0.00000 0.21765 $sigmasq [1] 0.075755 0.153082 0.217650 $decomp $decomp$d [1] 4 $decomp$G [1] 3 $decomp$scale [1] 0.075755 0.153082 0.217650 $pro [1] 0.3333333 0.3333333 0.3333333 $modelName [1] "VII" > > > > cleanEx(); ..nameEx <- "mvn" > > ### * mvn > > flush(stderr()); flush(stdout()) > > ### Name: mvn > ### Title: Multivariate Normal Fit > ### Aliases: mvn > ### Keywords: cluster > > ### ** Examples > > n <- 1000 > > set.seed(0) > x <- rnorm(n, mean = -1, sd = 2) > mvn(modelName = "X", x) $n [1] 1000 $d [1] 1 $G [1] 1 $mu [1] -1.031659 $sigmasq [1] 3.980071 $loglik [1] -2109.588 $modelName [1] "X" > > mu <- c(-1, 0, 1) > > set.seed(0) > x <- sweep(matrix(rnorm(n*3), n, 3) %*% (2*diag(3)), + MARGIN = 2, STATS = mu, FUN = "+") > mvn(modelName = "XII", x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.03165915 [2,] -0.04957289 [3,] 1.13628546 $sigmasq [1] 3.963291 $sigma , , 1 [,1] [,2] [,3] [1,] 3.963291 0.000000 0.000000 [2,] 0.000000 3.963291 0.000000 [3,] 0.000000 0.000000 3.963291 $Sigma [,1] [,2] [,3] [1,] 3.963291 0.000000 0.000000 [2,] 0.000000 3.963291 0.000000 [3,] 0.000000 0.000000 3.963291 $decomp $decomp$d [1] 3 $decomp$G [1] 1 $decomp$scale [1] 3.963291 $loglik [1] -6322.428 $modelName [1] "XII" > mvn(modelName = "Spherical", x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.03165915 [2,] -0.04957289 [3,] 1.13628546 $sigmasq [1] 3.963291 $sigma , , 1 [,1] [,2] [,3] [1,] 3.963291 0.000000 0.000000 [2,] 0.000000 3.963291 0.000000 [3,] 0.000000 0.000000 3.963291 $Sigma [,1] [,2] [,3] [1,] 3.963291 0.000000 0.000000 [2,] 0.000000 3.963291 0.000000 [3,] 0.000000 0.000000 3.963291 $decomp $decomp$d [1] 3 $decomp$G [1] 1 $decomp$scale [1] 3.963291 $loglik [1] -6322.428 $modelName [1] "XII" > > set.seed(0) > x <- sweep(matrix(rnorm(n*3), n, 3) %*% diag(1:3), + MARGIN = 2, STATS = mu, FUN = "+") > mvn(modelName = "XXI", x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.01582957 [2,] -0.04957289 [3,] 1.20442820 $sigma , , 1 [,1] [,2] [,3] [1,] 0.9950176 0.00000 0.000000 [2,] 0.0000000 4.27032 0.000000 [3,] 0.0000000 0.00000 8.188836 $Sigma [,1] [,2] [,3] [1,] 0.9950176 0.00000 0.000000 [2,] 0.0000000 4.27032 0.000000 [3,] 0.0000000 0.00000 8.188836 $decomp $decomp$p [1] 3 $decomp$G [1] 1 $decomp$scale [1] 3.264659 $decomp$shape [1] 0.3047846 1.3080448 2.5083282 $loglik [1] -6031.548 $modelName [1] "XXI" > mvn(modelName = "Diagonal", x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.01582957 [2,] -0.04957289 [3,] 1.20442820 $sigma , , 1 [,1] [,2] [,3] [1,] 0.9950176 0.00000 0.000000 [2,] 0.0000000 4.27032 0.000000 [3,] 0.0000000 0.00000 8.188836 $Sigma [,1] [,2] [,3] [1,] 0.9950176 0.00000 0.000000 [2,] 0.0000000 4.27032 0.000000 [3,] 0.0000000 0.00000 8.188836 $decomp $decomp$p [1] 3 $decomp$G [1] 1 $decomp$scale [1] 3.264659 $decomp$shape [1] 0.3047846 1.3080448 2.5083282 $loglik [1] -6031.548 $modelName [1] "XXI" > > Sigma <- matrix(c(9,-4,1,-4,9,4,1,4,9), 3, 3) > set.seed(0) > x <- sweep(matrix(rnorm(n*3), n, 3) %*% chol(Sigma), + MARGIN = 2, STATS = mu, FUN = "+") > mvn(modelName = "XXX", x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.04748872 [2,] -0.04550547 [3,] 1.12277306 $sigma , , 1 [,1] [,2] [,3] [1,] 8.955159 -4.084953 1.015574 [2,] -4.084953 9.572449 4.417112 [3,] 1.015574 4.417112 8.800769 $Sigma [,1] [,2] [,3] [1,] 8.955159 -4.084953 1.015574 [2,] -4.084953 9.572449 4.417112 [3,] 1.015574 4.417112 8.800769 $cholSigma [,1] [,2] [,3] [1,] 2.992517 -1.365056 0.3393713 [2,] 0.000000 -2.776521 -1.7577291 [3,] 0.000000 0.000000 -2.3655833 attr(,"def") [1] "Sigma = t(chol) %*% chol" $loglik [1] -7235.154 $modelName [1] "XXX" > mvn(modelName = "Ellipsoidal", x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.04748872 [2,] -0.04550547 [3,] 1.12277306 $sigma , , 1 [,1] [,2] [,3] [1,] 8.955159 -4.084953 1.015574 [2,] -4.084953 9.572449 4.417112 [3,] 1.015574 4.417112 8.800769 $Sigma [,1] [,2] [,3] [1,] 8.955159 -4.084953 1.015574 [2,] -4.084953 9.572449 4.417112 [3,] 1.015574 4.417112 8.800769 $cholSigma [,1] [,2] [,3] [1,] 2.992517 -1.365056 0.3393713 [2,] 0.000000 -2.776521 -1.7577291 [3,] 0.000000 0.000000 -2.3655833 attr(,"def") [1] "Sigma = t(chol) %*% chol" $loglik [1] -7235.154 $modelName [1] "XXX" > > > > cleanEx(); ..nameEx <- "mvnX" > > ### * mvnX > > flush(stderr()); flush(stdout()) > > ### Name: mvnX > ### Title: Multivariate Normal Fit > ### Aliases: mvnX mvnXII mvnXXI mvnXXX > ### Keywords: cluster > > ### ** Examples > > n <- 1000 > > set.seed(0) > x <- rnorm(n, mean = -1, sd = 2) > mvnX(x) $n [1] 1000 $d [1] 1 $G [1] 1 $mu [1] -1.031659 $sigmasq [1] 3.980071 $loglik [1] -2109.588 $modelName [1] "X" > > mu <- c(-1, 0, 1) > > set.seed(0) > x <- sweep(matrix(rnorm(n*3), n, 3) %*% (2*diag(3)), + MARGIN = 2, STATS = mu, FUN = "+") > mvnXII(x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.03165915 [2,] -0.04957289 [3,] 1.13628546 $sigmasq [1] 3.963291 $sigma , , 1 [,1] [,2] [,3] [1,] 3.963291 0.000000 0.000000 [2,] 0.000000 3.963291 0.000000 [3,] 0.000000 0.000000 3.963291 $Sigma [,1] [,2] [,3] [1,] 3.963291 0.000000 0.000000 [2,] 0.000000 3.963291 0.000000 [3,] 0.000000 0.000000 3.963291 $decomp $decomp$d [1] 3 $decomp$G [1] 1 $decomp$scale [1] 3.963291 $loglik [1] -6322.428 $modelName [1] "XII" > > set.seed(0) > x <- sweep(matrix(rnorm(n*3), n, 3) %*% diag(1:3), + MARGIN = 2, STATS = mu, FUN = "+") > mvnXXI(x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.01582957 [2,] -0.04957289 [3,] 1.20442820 $sigma , , 1 [,1] [,2] [,3] [1,] 0.9950176 0.00000 0.000000 [2,] 0.0000000 4.27032 0.000000 [3,] 0.0000000 0.00000 8.188836 $Sigma [,1] [,2] [,3] [1,] 0.9950176 0.00000 0.000000 [2,] 0.0000000 4.27032 0.000000 [3,] 0.0000000 0.00000 8.188836 $decomp $decomp$p [1] 3 $decomp$G [1] 1 $decomp$scale [1] 3.264659 $decomp$shape [1] 0.3047846 1.3080448 2.5083282 $loglik [1] -6031.548 $modelName [1] "XXI" > > Sigma <- matrix(c(9,-4,1,-4,9,4,1,4,9), 3, 3) > set.seed(0) > x <- sweep(matrix(rnorm(n*3), n, 3) %*% chol(Sigma), + MARGIN = 2, STATS = mu, FUN = "+") > mvnXXX(x) $n [1] 1000 $d [1] 3 $G [1] 1 $mu [,1] [1,] -1.04748872 [2,] -0.04550547 [3,] 1.12277306 $sigma , , 1 [,1] [,2] [,3] [1,] 8.955159 -4.084953 1.015574 [2,] -4.084953 9.572449 4.417112 [3,] 1.015574 4.417112 8.800769 $Sigma [,1] [,2] [,3] [1,] 8.955159 -4.084953 1.015574 [2,] -4.084953 9.572449 4.417112 [3,] 1.015574 4.417112 8.800769 $cholSigma [,1] [,2] [,3] [1,] 2.992517 -1.365056 0.3393713 [2,] 0.000000 -2.776521 -1.7577291 [3,] 0.000000 0.000000 -2.3655833 attr(,"def") [1] "Sigma = t(chol) %*% chol" $loglik [1] -7235.154 $modelName [1] "XXX" > > > > cleanEx(); ..nameEx <- "partconv" > > ### * partconv > > flush(stderr()); flush(stdout()) > > ### Name: partconv > ### Title: Convert partitioning into numerical vector. > ### Aliases: partconv > ### Keywords: cluster > > ### ** Examples > > data(iris) > partconv(iris[,5]) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 [75] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 [112] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 [149] 3 3 > > cl <- sample(1:10, 25, replace=TRUE) > partconv(cl, consec=FALSE) [1] 1 2 3 4 1 6 4 8 8 10 1 12 8 2 15 16 15 4 2 15 4 1 8 12 1 > partconv(cl, consec=TRUE) [1] 1 2 3 4 1 5 4 6 6 7 1 8 6 2 9 10 9 4 2 9 4 1 6 8 1 > > > > cleanEx(); ..nameEx <- "partuniq" > > ### * partuniq > > flush(stderr()); flush(stdout()) > > ### Name: partuniq > ### Title: Classifies Data According to Unique Observations > ### Aliases: partuniq > ### Keywords: cluster > > ### ** Examples > > data(iris) > partuniq(as.matrix(iris[,1:4])) [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 [37] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [55] 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 [73] 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 [91] 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 [109] 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 [127] 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 102 144 [145] 145 146 147 148 149 150 > > > > cleanEx(); ..nameEx <- "plot.Mclust" > > ### * plot.Mclust > > flush(stderr()); flush(stdout()) > > ### Name: plot.Mclust > ### Title: Plot Model-Based Clustering Results > ### Aliases: plot.Mclust > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisMclust <- Mclust(irisMatrix) > > ## Not run: plot(irisMclust,irisMatrix) > > > > cleanEx(); ..nameEx <- "plot.mclustDA" > > ### * plot.mclustDA > > flush(stderr()); flush(stdout()) > > ### Name: plot.mclustDA > ### Title: Plotting method for MclustDA discriminant analysis. > ### Aliases: plot.mclustDA > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > ## Not run: > ##D mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE) > ## End(Not run) > odd <- seq(from = 1, to = 2*n, by = 2) > even <- odd + 1 > testMclustDA <- mclustDA(trainingData = x[odd, ], labels = xclass[odd], + testData = x[even,]) > > clEven <- testMclustDA$testClassification ## classify training set > compareClass(clEven,xclass[even]) [1] 0.06952664 > > ## Not run: > ##D plot(testMclustDA, trainingData = x[odd, ], labels = xclass[odd], > ##D testData = x[even,]) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "randProj" > > ### * randProj > > flush(stderr()); flush(stdout()) > > ### Name: randProj > ### Title: Random projections for data in more than two dimensions modelled > ### by an MVN mixture. > ### Aliases: randProj > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstepVVV(irisMatrix, unmap(irisClass)) > > par(pty = "s", mfrow = c(2,3)) > randProj(irisMatrix, seeds = 0:5, truth=irisClass, + mu = msEst$mu, sigma = msEst$sigma, z = msEst$z) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function > do.call("randProj", c(list(data = irisMatrix, seeds = 0:5, truth=irisClass), + msEst)) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "sigma2decomp" > > ### * sigma2decomp > > flush(stderr()); flush(stdout()) > > ### Name: sigma2decomp > ### Title: Convert mixture component covariances to decomposition form. > ### Aliases: sigma2decomp > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > meEst <- meEEE(irisMatrix, unmap(irisClass)) > names(meEst) [1] "n" "d" "G" "z" "mu" "sigma" [7] "Sigma" "cholSigma" "pro" "loglik" "Vinv" "modelName" > meEst$sigma , , 1 [,1] [,2] [,3] [,4] [1,] 0.26387916 0.08987702 0.16956251 0.03932391 [2,] 0.08987702 0.11197340 0.05118186 0.03002534 [3,] 0.16956251 0.05118186 0.18637706 0.04196406 [4,] 0.03932391 0.03002534 0.04196406 0.03974960 , , 2 [,1] [,2] [,3] [,4] [1,] 0.26387916 0.08987702 0.16956251 0.03932391 [2,] 0.08987702 0.11197340 0.05118186 0.03002534 [3,] 0.16956251 0.05118186 0.18637706 0.04196406 [4,] 0.03932391 0.03002534 0.04196406 0.03974960 , , 3 [,1] [,2] [,3] [,4] [1,] 0.26387916 0.08987702 0.16956251 0.03932391 [2,] 0.08987702 0.11197340 0.05118186 0.03002534 [3,] 0.16956251 0.05118186 0.18637706 0.04196406 [4,] 0.03932391 0.03002534 0.04196406 0.03974960 > > sigma2decomp(meEst$sigma) $d [1] 4 $G [1] 3 $scale [1] 0.08114033 $shape [1] 5.4441760 1.0696919 0.6344826 0.2706384 $orientation [,1] [,2] [,3] [,4] [1,] 0.74019804 0.3056652 0.5783262 0.1556100 [2,] 0.01338854 -0.8711960 0.4757361 -0.1204715 [3,] 0.63520486 -0.2316293 -0.5625433 -0.4758232 [4,] 0.22009635 -0.3064868 -0.3503698 0.8572423 attr(,"modelName") [1] "EEE" > ## Not run: > ##D do.call("sigma2decomp", meEst) ## alternative call > ## End(Not run) > > > > cleanEx(); ..nameEx <- "sim" > > ### * sim > > flush(stderr()); flush(stdout()) > > ### Name: sim > ### Title: Simulate from Parameterized MVN Mixture Models > ### Aliases: sim > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > irisBic <- EMclust(irisMatrix) > irisSumry <- summary(irisBic,irisMatrix) > names(irisSumry) [1] "bic" "options" "classification" "uncertainty" [5] "n" "d" "G" "z" [9] "mu" "sigma" "decomp" "pro" [13] "loglik" "Vinv" "modelName" > irisSim <- sim(modelName = irisSumry$modelName, n = dim(irisMatrix)[1], + mu = irisSumry$mu, decomp = irisSumry$decomp, pro = irisSumry$pro) > ## Not run: > ##D irisSim <- do.call("sim", irisSumry) ## alternative call > ## End(Not run) > > par(pty = "s", mfrow = c(1,2)) > dimens <- c(1,2) > xlim <- range(rbind(irisMatrix,irisSim)[,dimens][,1]) > ylim <- range(rbind(irisMatrix,irisSim)[,dimens][,2]) > > cl <- irisSumry$classification > coordProj(irisMatrix, par=irisSumry, classification=cl, dimens=dimens, + xlim=xlim, ylim=ylim) Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > cl <- attr(irisSim,"classification") > coordProj(irisSim, par=irisSumry, classification=cl, dimens=dimens, + xlim=xlim, ylim=ylim) Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "par" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > > irisSumry3 <- summary(irisBic,irisMatrix, G=3) > irisSim3 <- do.call("sim", c(list(n = 500, seed = 1), irisSumry3)) > clPairs(irisSim3, cl = attr(irisSim3,"classification")) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "simE" > > ### * simE > > flush(stderr()); flush(stdout()) > > ### Name: simE > ### Title: Simulate from a Parameterized MVN Mixture Model > ### Aliases: simE simV simEII simVII simEEI simVEI simEVI simVVI simEEE > ### simEEV simVEV simVVV > ### Keywords: cluster > > ### ** Examples > > 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 , , 1 [,1] [,2] [1,] 1 0 [2,] 0 1 , , 2 [,1] [,2] [1,] 0 1 [2,] 1 0 > > decomp <- list(d= d, G = G, scale = scale, shape = shape, orientation = O) > mu <- matrix(0, d, G) ## center at the origin > simdat <- simEEV(n=200, mu=mu, decomp=decomp, pro = c(1,1)) > > cl <- attr(simdat, "classification") > 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) Warning: parameter "paramList" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "paramList" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "paramList" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "paramList" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "paramList" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function Warning: parameter "paramList" could not be set in high-level plot() function Warning: parameter "classification" could not be set in high-level plot() function > > > > cleanEx(); ..nameEx <- "spinProj" > > ### * spinProj > > flush(stderr()); flush(stdout()) > > ### Name: spinProj > ### Title: Planar spin for random projections of data in more than two > ### dimensions modelled by an MVN mixture. > ### Aliases: spinProj > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > msEst <- mstepVVV(irisMatrix, unmap(irisClass)) > > par(pty = "s", mfrow = c(2,2)) > spinProj(irisMatrix, seed = 1, truth=irisClass, + mu = msEst$mu, sigma = msEst$sigma, z = msEst$z) Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function > do.call("spinProj", c(list(data = irisMatrix, seeds = 2, truth=irisClass), + msEst)) Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function Warning: parameter "seeds" could not be set in high-level plot() function Warning: parameter "truth" could not be set in high-level plot() function Warning: parameter "n" could not be set in high-level plot() function Warning: parameter "d" could not be set in high-level plot() function Warning: parameter "G" could not be set in high-level plot() function Warning: parameter "mu" could not be set in high-level plot() function Warning: parameter "sigma" could not be set in high-level plot() function Warning: parameter "cholsigma" could not be set in high-level plot() function Warning: parameter "pro" could not be set in high-level plot() function Warning: parameter "modelName" could not be set in high-level plot() function > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "summary.EMclust" > > ### * summary.EMclust > > flush(stderr()); flush(stdout()) > > ### Name: summary.EMclust > ### Title: Summary function for EMclust > ### Aliases: summary.EMclust print.summary.EMclust > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > irisBic <- EMclust(irisMatrix) > summary(irisBic, irisMatrix) classification table: 1 2 50 100 uncertainty (quartiles): 0% 25% 50% 75% 100% 0.000000e+00 0.000000e+00 0.000000e+00 8.917533e-12 2.025613e-04 best BIC values: VEV,2 VEV,3 VVV,2 -561.7285 -562.5519 -574.0178 best model: ellipsoidal, equal shape > summary(irisBic, irisMatrix, G = 1:6, modelName = c("VII", "VVI", "VVV")) classification table: 1 2 50 100 uncertainty (quartiles): 0% 25% 50% 75% 100% 0.000000e+00 0.000000e+00 0.000000e+00 6.585066e-12 6.278349e-04 best BIC values: VVV,2 VVV,3 VII,6 -574.0178 -580.8400 -705.7813 best model: ellipsoidal, unconstrained > > > > cleanEx(); ..nameEx <- "summary.EMclustN" > > ### * summary.EMclustN > > flush(stderr()); flush(stdout()) > > ### Name: summary.EMclustN > ### Title: summary function for EMclustN > ### Aliases: summary.EMclustN print.summary.EMclustN > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > b <- apply( irisMatrix, 2, range) > n <- 450 > set.seed(0) > poissonNoise <- apply(b, 2, function(x, n=n) + runif(n, min = x[1]-0.1, max = x[2]+.1), n = n) > set.seed(0) > noiseInit <- sample(c(TRUE,FALSE),size=150+450,replace=TRUE,prob=c(3,1)) > irisNoise <- rbind(irisMatrix, poissonNoise) > > Bic <- EMclustN(data=irisNoise, noise = noiseInit) > summary(Bic, irisNoise) classification table: 1 2 3 53 92 455 uncertainty (quartiles): 0% 25% 50% 75% 100% 0.000000e+00 0.000000e+00 5.377981e-08 2.308717e-02 4.861792e-01 best BIC values: VEV,2 VEV,3 EEE,3 -5668.291 -5708.722 -5680.509 best model: ellipsoidal, equal shape > summary(Bic, irisNoise, G = 0:6, modelName = c("VII", "VVI", "VVV")) classification table: 1 2 3 53 92 455 uncertainty (quartiles): 0% 25% 50% 75% 100% 0.000000e+00 0.000000e+00 2.604107e-08 2.273205e-02 4.997245e-01 best BIC values: VVV,2 VVV,3 VII,3 -5681.329 -5744.728 -5777.704 best model: ellipsoidal, unconstrained > > > > cleanEx(); ..nameEx <- "summary.mclustDAtest" > > ### * summary.mclustDAtest > > flush(stderr()); flush(stdout()) > > ### Name: summary.mclustDAtest > ### Title: Classification and posterior probability from mclustDAtest. > ### Aliases: summary.mclustDAtest > ### Keywords: cluster > > ### ** Examples > > set.seed(0) > n <- 100 ## create artificial data > > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > ## Not run: > ##D par(pty = "s") > ##D mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE) > ## End(Not run) > > odd <- seq(1, 2*n, 2) > train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step XXX XXX 1 1 > summary(train) $"1" $"1"$model [1] "XXX,1" $"1"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 $"2" $"2"$model [1] "XXX,1" $"2"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 > > even <- seq(1, 2*n, 2) > test <- mclustDAtest(x[even, ], train) ## compute model densities > testSummary <- summary(test) ## classify training set > > names(testSummary) [1] "classification" "z" > testSummary$class [1] "1" "1" "1" "1" "1" "1" "2" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [19] "1" "1" "1" "1" "1" "1" "1" "1" "2" "1" "1" "2" "1" "1" "1" "1" "1" "1" [37] "1" "1" "1" "1" "2" "1" "1" "1" "1" "2" "1" "1" "1" "1" "2" "2" "2" "2" [55] "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "2" "1" "2" "2" "1" [73] "1" "1" "2" "1" "2" "1" "2" "2" "2" "2" "2" "1" "2" "2" "2" "2" "2" "2" [91] "2" "2" "2" "2" "2" "2" "1" "2" "2" "2" > testSummary$z 1 2 [1,] 1.000000e+00 3.261052e-10 [2,] 9.999981e-01 1.919397e-06 [3,] 1.000000e+00 3.123402e-21 [4,] 1.000000e+00 8.901760e-27 [5,] 9.998991e-01 1.008947e-04 [6,] 9.975295e-01 2.470464e-03 [7,] 2.838017e-01 7.161983e-01 [8,] 1.000000e+00 4.726765e-46 [9,] 1.000000e+00 7.440414e-21 [10,] 9.998752e-01 1.247977e-04 [11,] 5.988915e-01 4.011085e-01 [12,] 1.000000e+00 4.594417e-19 [13,] 1.000000e+00 1.235218e-20 [14,] 1.000000e+00 1.357740e-36 [15,] 1.000000e+00 1.289987e-24 [16,] 1.000000e+00 1.579744e-37 [17,] 1.000000e+00 6.429088e-11 [18,] 1.000000e+00 2.861503e-08 [19,] 1.000000e+00 6.257965e-25 [20,] 1.000000e+00 1.442556e-12 [21,] 1.000000e+00 7.330657e-09 [22,] 9.740275e-01 2.597252e-02 [23,] 1.000000e+00 7.431817e-17 [24,] 1.000000e+00 4.093740e-20 [25,] 9.996330e-01 3.670363e-04 [26,] 1.000000e+00 1.532046e-35 [27,] 5.575794e-02 9.442421e-01 [28,] 1.000000e+00 1.683400e-13 [29,] 1.000000e+00 1.074726e-12 [30,] 4.041366e-02 9.595863e-01 [31,] 9.753317e-01 2.466833e-02 [32,] 1.000000e+00 2.145052e-114 [33,] 1.000000e+00 2.546513e-10 [34,] 9.999207e-01 7.928320e-05 [35,] 9.881596e-01 1.184037e-02 [36,] 1.000000e+00 7.281297e-58 [37,] 9.425932e-01 5.740684e-02 [38,] 1.000000e+00 4.679611e-15 [39,] 1.000000e+00 4.857650e-38 [40,] 9.999900e-01 1.004513e-05 [41,] 4.150398e-01 5.849602e-01 [42,] 9.999969e-01 3.100176e-06 [43,] 9.999680e-01 3.196752e-05 [44,] 5.999353e-01 4.000647e-01 [45,] 6.671127e-01 3.328873e-01 [46,] 2.981343e-01 7.018657e-01 [47,] 1.000000e+00 8.892505e-67 [48,] 1.000000e+00 1.592361e-15 [49,] 1.000000e+00 7.359043e-19 [50,] 9.961491e-01 3.850924e-03 [51,] 3.942272e-01 6.057728e-01 [52,] 2.619702e-09 1.000000e+00 [53,] 3.144593e-02 9.685541e-01 [54,] 4.384029e-04 9.995616e-01 [55,] 4.909304e-02 9.509070e-01 [56,] 1.376621e-51 1.000000e+00 [57,] 2.216983e-25 1.000000e+00 [58,] 1.469116e-02 9.853088e-01 [59,] 1.053777e-02 9.894622e-01 [60,] 1.816234e-05 9.999818e-01 [61,] 5.614782e-04 9.994385e-01 [62,] 3.290851e-15 1.000000e+00 [63,] 8.968594e-24 1.000000e+00 [64,] 8.893493e-21 1.000000e+00 [65,] 5.227224e-36 1.000000e+00 [66,] 8.700224e-25 1.000000e+00 [67,] 1.335599e-02 9.866440e-01 [68,] 2.235570e-15 1.000000e+00 [69,] 7.662242e-01 2.337758e-01 [70,] 1.230909e-01 8.769091e-01 [71,] 4.448147e-08 1.000000e+00 [72,] 7.539095e-01 2.460905e-01 [73,] 8.731024e-01 1.268976e-01 [74,] 7.419178e-01 2.580822e-01 [75,] 2.843763e-01 7.156237e-01 [76,] 6.927277e-01 3.072723e-01 [77,] 9.630003e-05 9.999037e-01 [78,] 5.608524e-01 4.391476e-01 [79,] 4.018718e-01 5.981282e-01 [80,] 2.158414e-01 7.841586e-01 [81,] 3.859140e-11 1.000000e+00 [82,] 3.377541e-06 9.999966e-01 [83,] 1.929608e-01 8.070392e-01 [84,] 7.367952e-01 2.632048e-01 [85,] 3.751260e-06 9.999962e-01 [86,] 2.131225e-61 1.000000e+00 [87,] 1.676929e-08 1.000000e+00 [88,] 1.592111e-19 1.000000e+00 [89,] 5.271688e-34 1.000000e+00 [90,] 1.929533e-16 1.000000e+00 [91,] 3.655787e-01 6.344213e-01 [92,] 1.214464e-14 1.000000e+00 [93,] 8.024972e-08 9.999999e-01 [94,] 2.802370e-17 1.000000e+00 [95,] 1.462967e-01 8.537033e-01 [96,] 7.155480e-215 1.000000e+00 [97,] 7.541637e-01 2.458363e-01 [98,] 4.744046e-07 9.999995e-01 [99,] 2.006312e-51 1.000000e+00 [100,] 1.228425e-02 9.877157e-01 > > > > cleanEx(); ..nameEx <- "summary.mclustDAtrain" > > ### * summary.mclustDAtrain > > flush(stderr()); flush(stdout()) > > ### Name: summary.mclustDAtrain > ### Title: Models and classifications from mclustDAtrain > ### Aliases: summary.mclustDAtrain > ### Keywords: cluster > > ### ** Examples > > set.seed(0) > n <- 100 ## create artificial data > > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > ## Not run: > ##D par(pty = "s") > ##D mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE) > ## End(Not run) > > odd <- seq(1, 2*n, 2) > train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step XXX XXX 1 1 > summary(train) $"1" $"1"$model [1] "XXX,1" $"1"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 $"2" $"2"$model [1] "XXX,1" $"2"$classification [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 > > > > cleanEx(); ..nameEx <- "surfacePlot" > > ### * surfacePlot > > flush(stderr()); flush(stdout()) > > ### Name: surfacePlot > ### Title: Density or uncertainty surface for two dimensional mixtures. > ### Aliases: surfacePlot > ### Keywords: cluster > > ### ** Examples > > n <- 250 ## create artificial data > set.seed(0) > x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)), + matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1]) > xclass <- c(rep(1,n),rep(2,n)) > > xEMclust <- summary(EMclust(x),x) > surfacePlot(x, mu = xEMclust$mu, sigma = xEMclust$sigma, pro=xEMclust$pro, + type = "contour", what = "density", transformation = "none") > > ## Not run: do.call("surfacePlot", c(list(data = x), xEMclust)) > > > > cleanEx(); ..nameEx <- "uncerPlot" > > ### * uncerPlot > > flush(stderr()); flush(stdout()) > > ### Name: uncerPlot > ### Title: Uncertainty Plot for Model-Based Clustering > ### Aliases: uncerPlot > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > > irisBic <- EMclust(irisMatrix) > irisSumry3 <- summary(irisBic, irisMatrix, G = 3) > > uncerPlot(z = irisSumry3$z) > > uncerPlot(z = irisSumry3$z, truth = rep(1:3, rep(50,3))) > > do.call("uncerPlot", c(irisSumry3, list(truth = rep(1:3, rep(50,3))))) > > > > cleanEx(); ..nameEx <- "unmap" > > ### * unmap > > flush(stderr()); flush(stdout()) > > ### Name: unmap > ### Title: Indicator Variables given Classification > ### Aliases: unmap > ### Keywords: cluster > > ### ** Examples > > data(iris) > irisMatrix <- as.matrix(iris[,1:4]) > irisClass <- iris[,5] > > z <- unmap(irisClass) > z setosa versicolor virginica [1,] 1 0 0 [2,] 1 0 0 [3,] 1 0 0 [4,] 1 0 0 [5,] 1 0 0 [6,] 1 0 0 [7,] 1 0 0 [8,] 1 0 0 [9,] 1 0 0 [10,] 1 0 0 [11,] 1 0 0 [12,] 1 0 0 [13,] 1 0 0 [14,] 1 0 0 [15,] 1 0 0 [16,] 1 0 0 [17,] 1 0 0 [18,] 1 0 0 [19,] 1 0 0 [20,] 1 0 0 [21,] 1 0 0 [22,] 1 0 0 [23,] 1 0 0 [24,] 1 0 0 [25,] 1 0 0 [26,] 1 0 0 [27,] 1 0 0 [28,] 1 0 0 [29,] 1 0 0 [30,] 1 0 0 [31,] 1 0 0 [32,] 1 0 0 [33,] 1 0 0 [34,] 1 0 0 [35,] 1 0 0 [36,] 1 0 0 [37,] 1 0 0 [38,] 1 0 0 [39,] 1 0 0 [40,] 1 0 0 [41,] 1 0 0 [42,] 1 0 0 [43,] 1 0 0 [44,] 1 0 0 [45,] 1 0 0 [46,] 1 0 0 [47,] 1 0 0 [48,] 1 0 0 [49,] 1 0 0 [50,] 1 0 0 [51,] 0 1 0 [52,] 0 1 0 [53,] 0 1 0 [54,] 0 1 0 [55,] 0 1 0 [56,] 0 1 0 [57,] 0 1 0 [58,] 0 1 0 [59,] 0 1 0 [60,] 0 1 0 [61,] 0 1 0 [62,] 0 1 0 [63,] 0 1 0 [64,] 0 1 0 [65,] 0 1 0 [66,] 0 1 0 [67,] 0 1 0 [68,] 0 1 0 [69,] 0 1 0 [70,] 0 1 0 [71,] 0 1 0 [72,] 0 1 0 [73,] 0 1 0 [74,] 0 1 0 [75,] 0 1 0 [76,] 0 1 0 [77,] 0 1 0 [78,] 0 1 0 [79,] 0 1 0 [80,] 0 1 0 [81,] 0 1 0 [82,] 0 1 0 [83,] 0 1 0 [84,] 0 1 0 [85,] 0 1 0 [86,] 0 1 0 [87,] 0 1 0 [88,] 0 1 0 [89,] 0 1 0 [90,] 0 1 0 [91,] 0 1 0 [92,] 0 1 0 [93,] 0 1 0 [94,] 0 1 0 [95,] 0 1 0 [96,] 0 1 0 [97,] 0 1 0 [98,] 0 1 0 [99,] 0 1 0 [100,] 0 1 0 [101,] 0 0 1 [102,] 0 0 1 [103,] 0 0 1 [104,] 0 0 1 [105,] 0 0 1 [106,] 0 0 1 [107,] 0 0 1 [108,] 0 0 1 [109,] 0 0 1 [110,] 0 0 1 [111,] 0 0 1 [112,] 0 0 1 [113,] 0 0 1 [114,] 0 0 1 [115,] 0 0 1 [116,] 0 0 1 [117,] 0 0 1 [118,] 0 0 1 [119,] 0 0 1 [120,] 0 0 1 [121,] 0 0 1 [122,] 0 0 1 [123,] 0 0 1 [124,] 0 0 1 [125,] 0 0 1 [126,] 0 0 1 [127,] 0 0 1 [128,] 0 0 1 [129,] 0 0 1 [130,] 0 0 1 [131,] 0 0 1 [132,] 0 0 1 [133,] 0 0 1 [134,] 0 0 1 [135,] 0 0 1 [136,] 0 0 1 [137,] 0 0 1 [138,] 0 0 1 [139,] 0 0 1 [140,] 0 0 1 [141,] 0 0 1 [142,] 0 0 1 [143,] 0 0 1 [144,] 0 0 1 [145,] 0 0 1 [146,] 0 0 1 [147,] 0 0 1 [148,] 0 0 1 [149,] 0 0 1 [150,] 0 0 1 > > emEst <- me(modelName = "VVV", data = irisMatrix, z = z) > emEst$z setosa versicolor virginica [1,] 1.000000e+00 1.340380e-44 1.861339e-34 [2,] 1.000000e+00 2.201405e-31 6.676298e-28 [3,] 1.000000e+00 1.896748e-36 1.102178e-29 [4,] 1.000000e+00 3.488647e-32 6.409600e-26 [5,] 1.000000e+00 4.393475e-47 7.745885e-35 [6,] 1.000000e+00 1.278514e-45 9.141846e-35 [7,] 1.000000e+00 1.725033e-36 1.528128e-28 [8,] 1.000000e+00 1.013323e-40 1.687173e-31 [9,] 1.000000e+00 6.118503e-28 6.204452e-24 [10,] 1.000000e+00 3.941874e-36 2.494386e-28 [11,] 1.000000e+00 4.448705e-50 1.929162e-37 [12,] 1.000000e+00 3.292550e-39 7.578657e-29 [13,] 1.000000e+00 2.565267e-34 5.452124e-28 [14,] 1.000000e+00 9.106612e-35 1.909555e-27 [15,] 1.000000e+00 3.125165e-63 1.593148e-47 [16,] 1.000000e+00 1.896077e-64 4.876149e-46 [17,] 1.000000e+00 5.596191e-50 1.021588e-39 [18,] 1.000000e+00 6.308031e-41 2.149597e-33 [19,] 1.000000e+00 2.370660e-47 1.329559e-36 [20,] 1.000000e+00 4.052147e-48 1.898553e-35 [21,] 1.000000e+00 3.784797e-39 8.212299e-31 [22,] 1.000000e+00 2.257628e-41 6.202577e-33 [23,] 1.000000e+00 6.419874e-48 7.020340e-35 [24,] 1.000000e+00 6.639759e-26 1.443374e-24 [25,] 1.000000e+00 7.175865e-36 2.846195e-24 [26,] 1.000000e+00 1.227836e-29 6.692266e-26 [27,] 1.000000e+00 1.658055e-32 6.789689e-28 [28,] 1.000000e+00 6.872462e-44 7.516822e-34 [29,] 1.000000e+00 4.516919e-42 6.057310e-34 [30,] 1.000000e+00 6.438483e-34 2.970895e-26 [31,] 1.000000e+00 9.491263e-32 6.566490e-26 [32,] 1.000000e+00 1.359677e-34 1.377621e-31 [33,] 1.000000e+00 1.807081e-66 1.923514e-41 [34,] 1.000000e+00 2.640245e-67 1.082266e-45 [35,] 1.000000e+00 6.866910e-33 9.278292e-28 [36,] 1.000000e+00 5.302053e-38 1.312420e-32 [37,] 1.000000e+00 3.083368e-46 5.787644e-38 [38,] 1.000000e+00 1.102357e-50 7.771785e-35 [39,] 1.000000e+00 8.786404e-31 1.026566e-25 [40,] 1.000000e+00 6.077402e-41 4.042171e-32 [41,] 1.000000e+00 1.877063e-41 1.037298e-33 [42,] 1.000000e+00 3.904478e-15 2.495765e-19 [43,] 1.000000e+00 2.822962e-35 2.367557e-27 [44,] 1.000000e+00 1.608040e-27 5.055302e-25 [45,] 1.000000e+00 3.082923e-39 2.560673e-28 [46,] 1.000000e+00 4.000241e-28 2.471836e-26 [47,] 1.000000e+00 2.987492e-51 3.564570e-35 [48,] 1.000000e+00 2.344766e-35 6.084895e-28 [49,] 1.000000e+00 7.194407e-50 8.191014e-37 [50,] 1.000000e+00 5.327318e-39 1.230925e-31 [51,] 3.032539e-92 9.997227e-01 2.773164e-04 [52,] 1.150038e-83 9.986288e-01 1.371182e-03 [53,] 1.797174e-104 9.944941e-01 5.505859e-03 [54,] 1.115012e-63 9.320826e-01 6.791742e-02 [55,] 4.881945e-92 9.705411e-01 2.945894e-02 [56,] 2.954459e-79 9.685784e-01 3.142162e-02 [57,] 8.550867e-94 9.865626e-01 1.343744e-02 [58,] 3.765759e-34 9.998441e-01 1.558591e-04 [59,] 1.336478e-86 9.986175e-01 1.382503e-03 [60,] 1.747387e-60 9.669572e-01 3.304278e-02 [61,] 3.021885e-42 9.982058e-01 1.794178e-03 [62,] 1.635100e-72 9.927992e-01 7.200848e-03 [63,] 4.079064e-61 9.991369e-01 8.630789e-04 [64,] 1.012713e-90 9.670966e-01 3.290342e-02 [65,] 7.559543e-47 9.997995e-01 2.005120e-04 [66,] 3.050597e-79 9.998767e-01 1.232632e-04 [67,] 1.489175e-83 9.246757e-01 7.532431e-02 [68,] 8.933659e-58 9.965960e-01 3.404046e-03 [69,] 3.934648e-92 2.925580e-03 9.970744e-01 [70,] 7.242827e-55 9.995024e-01 4.975685e-04 [71,] 7.707744e-106 5.397566e-02 9.460243e-01 [72,] 3.850909e-62 9.998443e-01 1.556841e-04 [73,] 4.713812e-107 4.325311e-02 9.567469e-01 [74,] 3.438056e-86 9.136402e-01 8.635976e-02 [75,] 1.817276e-73 9.997824e-01 2.176209e-04 [76,] 6.615926e-80 9.997244e-01 2.755883e-04 [77,] 3.767869e-100 9.879246e-01 1.207544e-02 [78,] 1.254096e-114 3.361880e-01 6.638120e-01 [79,] 4.845433e-85 9.646654e-01 3.533460e-02 [80,] 2.507098e-39 9.999864e-01 1.363479e-05 [81,] 3.878089e-52 9.995100e-01 4.900484e-04 [82,] 8.943244e-47 9.998196e-01 1.803552e-04 [83,] 4.112093e-56 9.998282e-01 1.717912e-04 [84,] 1.761949e-116 6.973648e-03 9.930264e-01 [85,] 1.873570e-83 8.494274e-01 1.505726e-01 [86,] 4.330051e-84 9.873428e-01 1.265717e-02 [87,] 1.827651e-94 9.975530e-01 2.447044e-03 [88,] 2.149510e-82 9.204475e-01 7.955247e-02 [89,] 1.777598e-62 9.985437e-01 1.456316e-03 [90,] 1.223594e-62 9.899298e-01 1.007019e-02 [91,] 1.057937e-73 9.412283e-01 5.877173e-02 [92,] 1.119977e-85 9.910150e-01 8.985033e-03 [93,] 1.917546e-60 9.995110e-01 4.889726e-04 [94,] 5.809300e-35 9.998832e-01 1.168043e-04 [95,] 1.439348e-68 9.937569e-01 6.243104e-03 [96,] 4.058872e-63 9.973306e-01 2.669419e-03 [97,] 3.805944e-67 9.979620e-01 2.037953e-03 [98,] 1.658725e-72 9.994971e-01 5.028802e-04 [99,] 3.308948e-28 9.999418e-01 5.818736e-05 [100,] 1.884676e-64 9.986048e-01 1.395245e-03 [101,] 3.010949e-203 5.530199e-17 1.000000e+00 [102,] 1.753436e-128 1.077534e-07 9.999999e-01 [103,] 3.185553e-181 2.653929e-09 1.000000e+00 [104,] 1.348868e-148 4.312002e-05 9.999569e-01 [105,] 9.131952e-178 7.830553e-12 1.000000e+00 [106,] 1.376312e-228 2.727688e-11 1.000000e+00 [107,] 3.275601e-95 1.168041e-05 9.999883e-01 [108,] 1.485822e-196 1.996513e-07 9.999998e-01 [109,] 1.096470e-166 5.615666e-09 1.000000e+00 [110,] 1.838986e-207 5.153929e-13 1.000000e+00 [111,] 1.407473e-129 6.017637e-05 9.999398e-01 [112,] 7.916908e-140 1.650636e-07 9.999998e-01 [113,] 9.136916e-158 5.957065e-09 1.000000e+00 [114,] 1.956477e-130 2.233857e-12 1.000000e+00 [115,] 2.022253e-156 3.404704e-22 1.000000e+00 [116,] 9.392240e-156 1.026315e-12 1.000000e+00 [117,] 6.602144e-143 7.801735e-04 9.992198e-01 [118,] 2.748870e-228 5.421043e-06 9.999946e-01 [119,] 7.429637e-265 3.265440e-22 1.000000e+00 [120,] 1.370738e-113 5.282640e-05 9.999472e-01 [121,] 4.351788e-177 4.577282e-12 1.000000e+00 [122,] 1.054301e-123 3.279642e-09 1.000000e+00 [123,] 1.162139e-235 1.885723e-12 1.000000e+00 [124,] 6.201270e-116 5.216528e-05 9.999478e-01 [125,] 1.891890e-164 2.001713e-06 9.999980e-01 [126,] 1.323823e-172 7.420387e-04 9.992580e-01 [127,] 4.617100e-110 3.526679e-04 9.996473e-01 [128,] 2.794272e-112 5.946968e-03 9.940530e-01 [129,] 1.280855e-163 1.922717e-11 1.000000e+00 [130,] 3.061896e-157 4.726577e-03 9.952734e-01 [131,] 6.533587e-190 3.218376e-08 1.000000e+00 [132,] 4.771065e-201 6.006480e-03 9.939935e-01 [133,] 6.908783e-169 3.468057e-14 1.000000e+00 [134,] 2.744809e-113 2.199157e-01 7.800843e-01 [135,] 3.663047e-138 3.079362e-05 9.999692e-01 [136,] 2.609736e-207 1.978334e-14 1.000000e+00 [137,] 7.627542e-175 3.636807e-13 1.000000e+00 [138,] 2.136992e-141 2.459565e-03 9.975404e-01 [139,] 1.018504e-107 5.760480e-03 9.942395e-01 [140,] 8.410204e-152 7.863015e-08 9.999999e-01 [141,] 2.436458e-178 1.184065e-16 1.000000e+00 [142,] 2.086983e-148 3.695558e-14 1.000000e+00 [143,] 1.753436e-128 1.077534e-07 9.999999e-01 [144,] 1.276099e-187 4.205111e-12 1.000000e+00 [145,] 9.196112e-188 2.313054e-17 1.000000e+00 [146,] 1.126391e-153 3.179633e-15 1.000000e+00 [147,] 3.395534e-127 2.310806e-09 1.000000e+00 [148,] 1.300448e-136 1.192490e-06 9.999988e-01 [149,] 1.141901e-158 1.374617e-10 1.000000e+00 [150,] 2.488135e-121 1.722216e-03 9.982778e-01 > > map(emEst$z) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 3 2 3 2 [75] 2 2 2 3 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 [112] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 [149] 3 3 > > > > ### *