Last data update: 2014.03.03

R: Shows GMM
PlotMixturesR Documentation

Shows GMM

Description

Plots Gaussian Mixture Model without Bayes decision boundaries, such that:

Black is the PDE of Data

Red is color of the GMM

Blue is the color of components of the mixture

Usage

PlotMixtures(Data, Means, SDs, Weights,IsLogDistribution, SingleColor, 
MixtureColor,DataColor, SingleGausses,axes, xlab, ylab,xlim, ylim, ...)

Arguments

Data

vector (1:N) of data points

Means

vector[1:L] of Means of Gaussians (of GMM),L == Number of Gaussians

SDs

vector of standard deviations, estimated Gaussian Kernels, has to be the same length as Means

Weights

vector of relative number of points in Gaussians (prior probabilities), has to be the same length as Means

IsLogDistribution

Optional, ==1 if distribution(i) is a LogNormal, default vector of zeros of length 1:L

SingleColor

Optional,Color for line plot of all the single gaussians, default magenta

MixtureColor

Optional,Color of line lot for the mixture default red

DataColor

Optional,Color of line plot for the data, default black

axes

Optional,Default:TRUE with axis, see argument axis of plot

xlim

Optional, see plot

ylim

Optional, see plot

xlab

Optional, see plot

ylab

Optional, see plot

SingleGausses

Optional, If TRUE, single gaussians are shown, default FALSE

...

other plot arguments like xlim = c(1,10)

Author(s)

Michael Thrun

See Also

PlotMixturesAndBoundaries

Examples

data=c(rnorm(1000),rnorm(2000)+2,rnorm(1000)*2-1)
PlotMixtures(data,c(-1,0,2),c(2,1,1),c(0.25,0.25,0.5),SingleColor='blue',SingleGausses=TRUE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AdaptGauss)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AdaptGauss/PlotMixtures.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PlotMixtures
> ### Title: Shows GMM
> ### Aliases: PlotMixtures
> ### Keywords: GMM gaussian mixture model
> 
> ### ** Examples
> 
> data=c(rnorm(1000),rnorm(2000)+2,rnorm(1000)*2-1)
> PlotMixtures(data,c(-1,0,2),c(2,1,1),c(0.25,0.25,0.5),SingleColor='blue',SingleGausses=TRUE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>