Description Usage Arguments Value Examples
MBM.cluster
calculates a model based clustering using multivariate Bernoulli-mixtures as probabilistic model of the data.
The quality of the clustering is judged using the AIC criterion.
1 | MBM.cluster(data, min = 1, max = 10)
|
data |
A numeric matrix. |
min |
The minimal number of components that is tested. |
max |
The maximal number of components that is tested. |
A list with 3 elements. The first element is the minimal AIC value for each tested number of components.
The second element is a vector of all AIC values. The third is the actual clustering as returned by the EM algorithm using
the optimal number of components according to AIC. The element is again a list that contains the mixture coefficients, the actual
parameters of the mutlivariate Benroulli distributions, the probability matrix of each observation (i.e. row if data
)
and component and the number of iterations that the EM algorithm needed to converge.
1 2 3 4 5 6 7 8 9 10 | #Random data generation, 100 observations, 5 dimensions, dependencies within the dimensions
data = cbind(round(runif(100)), round(runif(100)), round(runif(100)))
data = cbind(data, data[,2], 1-data[,3])
#Noisy data:
s = round(runif(2, 1, 100))
data[s, c(4,5)] = 1 - data[s, c(4,5)]
#MBMM Clustering
res = MBM.cluster(data, 1,8)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.