if (FALSE) {
# Create an Interval-Data object containing the intervals of loan data
# (from the Kaggle Data Science platform) aggregated by loan purpose
LbyPIdt <- IData(LoansbyPurpose_minmaxDt,
VarNames=c("ln-inc","ln-revolbal","open-acc","total-acc"))
print(LbyPIdt)
#Fit homoscedastic Gaussian mixtures with up to nine components
mclustres <- Idtmclust(LbyPIdt)
plotInfCrt(mclustres,legpos="bottomright")
print(mclustres)
#Display the results of the best mixture according to the BIC
summary(mclustres,parameters=TRUE,classification=TRUE)
pcoordplot(mclustres)
#Repeat the analysus with both homoscedastic and heteroscedastic mixtures up to six components
mclustres1 <- Idtmclust(LbyPIdt,G=1:6,Mxt="HomandHet")
plotInfCrt(mclustres1,legpos="bottomright")
print(mclustres1)
#Display the results of the best heteroscedastic mixture according to the BIC
summary(mclustres1,parameters=TRUE,classification=TRUE,model="HetG2C2")
}
Run the code above in your browser using DataLab