createBicObject: Return a BIC object, such as one you would find in the mclust...

Description Usage Arguments Value Examples

Description

Return a BIC object, such as one you would find in the mclust package

Usage

1
createBicObject(modelNames, G, z = estep$z, data)

Arguments

modelNames

names of possible models

G

number of clusters

z

A matrix whose [i,k]th entry is the probability that observation i in the test data belongs to the kth class

data

the data you wish to use

Value

a BIC object (see mclustBIC in the mclust package)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#Load data
library(mclust)
data(banknote)

#Create new dataset with only continuous variables
bankdata <- banknote[,2:7]

#determine best model
model <- object$modelName
#extract model parameters
param <- object$parameters

#output from estep of EM algorithm
estepbank <- estep(model, bankdata, param)

#Create a BIC object, as seen in the mclust package's mclustBIC function
#Outputs BIC values for all models, but only for specified number of clusters
createBicObject(modelNames, G = object$G, z = estepbank$z, bankdata)

lsheremet/imbc documentation built on May 20, 2019, 7:01 p.m.