30_assign.class: Assign Class Id

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function assigns cluster id to each observation in x according to the desired model emobj or specified parameters pi, Mu, and LTSigma.

Usage

1
2
  assign.class(x, emobj = NULL, pi = NULL, Mu = NULL, LTSigma = NULL,
               lab = NULL, return.all = TRUE)

Arguments

x

the data matrix, dimension n * p.

emobj

the desired model which is a list mainly contains pi, Mu, and LTSigma, usually a returned object from init.EM.

pi

the mixing proportion, length K.

Mu

the centers of clusters, dimension K * p.

LTSigma

the lower triangular matrices of dispersion, dimension K * p(p+1)/2.

lab

labeled data for semi-supervised clustering, length n.

return.all

if returning with a whole emobj object.

Details

This function are based either an input emobj or inputs pi, Mu, and LTSigma to assign class id to each observation of x.

If lab is submitted, then the observation with label id greater 0 will not be assigned new class.

Value

This function returns a list containing mainly two new variables: nc (length K numbers of observations in each class) and class (length n class id).

Author(s)

Wei-Chen Chen wccsnow@gmail.com and Ranjan Maitra.

References

https://www.stat.iastate.edu/people/ranjan-maitra/

See Also

init.EM, emcluster.

Examples

1
2
3
4
5
6
7
library(EMCluster, quietly = TRUE)
set.seed(1234)
x2 <- da2$da

ret <- init.EM(x2, nclass = 2)
ret.new <- assign.class(x2, ret, return.all = FALSE)
str(ret.new)

EMCluster documentation built on May 2, 2019, 3:45 a.m.