plot_GMM {plotGMM}R Documentation

Plots Mixture Components from Gaussian Mixture Models

Description

Generates a plot of data densities with overlaid mixture components from a Gaussian mixture model (GMM)

Usage

plot_GMM(m, k=NULL)

Arguments

m

An object of class mixEM corresponding with the fit GMM

k

The number of components specified in the GMM, m

Details

Uses ggplot2 graphics to plot data densities with overlaid components from mixEM objects, which are GMM's fit using the mixtools package.

Note: Users must enter the same component value, k, in the plot_GMM function, as that which was specified in the original GMM specification (also k in mixtools).

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.

Wickham, H., 2016. ggplot2: elegant graphics for data analysis. Springer.

Examples

set.seed(235)
mixmdl <- mixtools::normalmixEM(faithful$waiting, k = 2)

plot_GMM(mixmdl, 2)

[Package plotGMM version 0.2.2 Index]