plot_cut_point {plotGMM}R Documentation

Plots Cut Point from Gaussian Mixture Models

Description

Returns a plot of the data density (histogram) with an overlaid cut point generated by a Gaussian mixture model

Usage

plot_cut_point(m, plot = TRUE, color = c("grayscale", "amerika", "wesanderson"))

Arguments

m

An object of class mixEM corresponding with the fit GMM

plot

A logical argument for generating the plot. If FALSE, only the cut point value from the GMM is returned. If TRUE, histogram with the overlaid cut point is returned. Default is set to TRUE.

color

A vector of color options including "amerika" (from package amerika), "wesanderson" (from package wesanderson), and "grayscale", which is the default option.

Details

Gaussian mixture models are often used to derive cut points, or lines of separation between clusters in feature space (See Benaglia et al. 2009 for more). The plot_cut_point function plots data densities with the overlaid cut point (the mean of the calculated mu) from mixEM objects, which are GMM's fit using the mixtools package.

References

Benaglia, T., Chauveau, D., Hunter, D. and Young, D. 2009. mixtools: An R package for analyzing finite mixture models. Journal of Statistical Software, 32(6), pp.1-29.

Ram, K., and Wickham, H. 2015. wesanderson: a Wes Anderson palette generator. R package version 0.3.

Examples

mixmdl <- mixtools::normalmixEM(faithful$waiting, k = 2)

plot_cut_point(mixmdl, plot = TRUE, color = "amerika") # returns plot, amerika
plot_cut_point(mixmdl, plot = TRUE, color = "wesanderson") # returns plot, wesanderson
plot_cut_point(mixmdl, plot = FALSE) # returns only the cut point value from the GMM

[Package plotGMM version 0.2.2 Index]