# NOT RUN {
devAskNewPage(ask = TRUE)
data("wine")
colnames(wine)
# Remove Cultivar column from wine dataset.
winecolnames <- !(colnames(wine) %in% "Cultivar")
wine <- wine[, winecolnames]
# Determine number of dimensions d and wine dataset size n.
d <- ncol(wine)
n <- nrow(wine)
# Estimate number of components, component weights and component parameters.
Sturges <- as.integer(1 + log2(n)) # Minimum v follows Sturges rule.
RootN <- as.integer(2 * n^0.5) # Maximum v follows RootN rule.
K <- c(floor(Sturges^(1/13)), ceiling(RootN^(1/13)))
wineest <- REBMIX(model = "REBMVNORM",
Dataset = list(wine = wine),
Preprocessing = "Parzen window",
Criterion = "ICL-BIC",
pdf = rep("normal", d),
K = K[1]:K[2])
# Plot finite mixture.
plot(wineest, what = c("density", "IC", "logL", "D"),
nrow = 2, ncol = 2, pty = "s")
# }
Run the code above in your browser using DataLab