em_clust_mvn: Clustering for Multivariate Normal data via EM

Description Usage Arguments Value See Also Examples

Description

This function uses the EM algorithm to do clustering in P-dimensions. It assumes all clusters are spherically N(μ_m, Σ_m I).

Usage

1
em_clust_mvn(data, nclust, itmax = 10000, tol = 10^-8)

Arguments

data

An 'n x p' data matrix or data frame.

nclust

The number of clusters.

itmax

The maximum number of iterations allowed. Defaults to 10000.

tol

Tuning parameter for convergence. Defaults to 10^-8.

Value

A list containing: it the number of iterations; clust_prop the estimated mixture proportions; clust_params the estimated mixture parameters; mix_est a vector of the estimated mixture for each data point; log_lik the log likelihood of the data; bic the modeled BIC.

See Also

em_clust_norm, em_clust_mvn_miss, gen_clust

Examples

1
2
3
4
5
6
7
# generate test data
c1 <- gen_clust(100, 10, mean= c(seq(-8, 10, 2)), sd= rep(1, 10))
c2 <- gen_clust(100, 10, mean= rep(0, 10), sd= rep(2, 10))
c3 <- gen_clust(100, 10, mean= rep(10, 10), sd= rep(1, 10))
c_tot <- rbind(c1,c2,c3); rm(c1,c2,c3)
# run example
mvn <- em_clust_mvn(c_tot, nclust= 3)

alexWhitworth/emclustr documentation built on May 11, 2019, 11:25 p.m.