**0**wrote:

I've just started using R a couple of weeks ago and I'm new to programming.

I'm doing some EM algorithm clustering using the `Mclust`

package provided in R. This seems to be exactly what I need, however the number of clusters that I get when I run it is more than I expect. I assume that my problem can be solved using prior control, but whenever I use the script

`mclustBIC(mydata, prior = priorControl())`

I get the following error message:

Error in chol.default(priorParams$scale) :

the leading minor of order 3 is not positive definite

Here's an example showing how prior control works:

treesBIC <- mclustBIC(trees) # default (no prior)

plot(treesBIC, legendArgs = list(x = "bottom", ncol = 2, cex = .75))

treesBICprior <- mclustBIC(trees, prior = priorControl()) # with prior

plot(treesBICprior, legendArgs = list(x = "bottom", ncol = 2, cex = .75))

**510**• written 2.3 years ago by mabdulsa •

**0**