Description Usage Arguments Value Examples

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

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

`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 |

a BIC object (see mclustBIC in the mclust package)

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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.