We will work with the geyser2 dataset, which contains two features (eruption length and previous eruption length). The objective is to cluster the data into three groups, taking care of the fact that there is a distinct covariance pattern in each cluster.
- First, we load the library, which includes the geyser2 dataset:
library(qclust)data ("geyser2")
- We estimate our clusters, using the qclust function. We want to get three clusters, and we set the q (robust parameter) to 0.99. We plot the clusters and the densities:
result_robust_mixture <- qclust::Qclust(geyser2,K=3,q=0.9999)plot(result_robust_mixture)
Estimated clusters—these covariance matrices are not very robust. The blue cluster seems to be suffering from the small ...