View source: R/gmm_functions.R
GMM_kmeans | R Documentation |
For a given number of clusters, find initial clusters and compute initial parameter estimates.
GMM_kmeans(y, k, iter.max = 30)
y |
An n by d numeric matrix with n observations of dimension d. |
k |
Number of cluster centers, passed to kmeans. |
iter.max |
The maximum number of iterations allowed, passed to kmeans. |
prop |
Proportion of observations assigned to each cluster. |
mu |
Vector of cluster means. |
sigma |
List of cluster variance covariance matrices. |
cluster |
Vecor of cluster labels. |
sim <- rGMCM(1500, prop = c(1/3,1/3,1/3), mu = list(c(-1,1), c(1,1), c(0,-sqrt(2))), sigma = list(rbind(c(0.65, 0.7794), c(0.7794, 1.55)), rbind(c(0.65, -0.7794), c(-0.7794, 1.55)), diag(c(2, 0.2)))) init <- GMM_kmeans(sim$data, k = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.