GMMplotGG {opGMMassessment}R Documentation

Plot of Gaussian mixtures

Description

The function plots the components of a Gaussian mixture and superimposes them on a histogram of the data.

Usage

GMMplotGG(Data, Means, SDs, Weights, BayesBoundaries, 
	SingleGausses = TRUE, Hist = FALSE, Bounds = TRUE, SumModes = TRUE, PDE = TRUE)

Arguments

Data

the data as a vector.

Means

a list of mean values for a Gaussian mixture.

SDs

a list of standard deviations for a Gaussian mixture.

Weights

a list of weights for a Gaussian mixture.

BayesBoundaries

a list of Bayesian boundaries for a Gaussian mixture.

SingleGausses

whether to plot the single Gaussian components as separate lines.

Hist

whether to plot a histgram of the original data.

Bounds

whether to plot the Bayesian boundaries for a Gaussian mixture as vertical lines.

SumModes

whether to plot the summed-up mixes.

PDE

whether to use the Pareto density estimation instead of the standard R density function.

Value

Returns a ggplot2 object.

p1

the plot of Gaussian mixtures.

Author(s)

Jorn Lotsch and Sebastian Malkusch

References

Lotsch, J., Malkusch S. (2021): opGMMassessment – an R Package for automated Guassian mixture modeling.

Examples

## example 1
data(iris)
Means0 <- tapply(X = as.vector(iris[,3]), INDEX =  as.integer(iris$Species), FUN = mean)
SDs0 <- tapply(X = as.vector(iris[,3]), INDEX =  as.integer(iris$Species), FUN = sd)
Weights0 <- c(1/3, 1/3, 1/3)
GMM.Sepal.Length <- GMMplotGG(Data = as.vector(iris[3]), 
	Means = Means0, 
	SDs = SDs0, 
	Weights = Weights0, 
	Hist = TRUE) 

[Package opGMMassessment version 0.4 Index]