GMM_kmeans: Initialize parameters for modified GMM using kmeans...

View source: R/gmm_functions.R

GMM_kmeansR Documentation

Initialize parameters for modified GMM using kmeans clustering.

Description

For a given number of clusters, find initial clusters and compute initial parameter estimates.

Usage

GMM_kmeans(y, k, iter.max = 30)

Arguments

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.

Value

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.

Author(s)

hbk5086@psu.edu

Examples

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)

hillarykoch/CLIMB documentation built on Oct. 24, 2022, 4:27 a.m.