Learn R Programming

AdaptGauss (version 1.2.0)

Pdf4Mixtures: Calculates pdf for GMM

Description

Calculate Gaussianthe probability density function for a Mixture Model

Usage

Pdf4Mixtures(Data, Means, SDs, Weights,IsLogDistribution,PlotIt)

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
PlotIt
Optional: =TRUE plot of pdf

Value

  • List with
  • PDF4modesmatrix, where the columns are the gaussians
  • PDFmatrix, where the columns are the gaussians weighted by Weights
  • PDFmixturelinear superpositions of PDF - prior probabilities of Gaussians

See Also

PlotMixtures

Examples

Run this code
data=c(rnorm(1000),rnorm(2000)+2,rnorm(1000)*2-1)
Pdf4Mixtures(data,c(-1,0,2),c(2,1,1),c(0.25,0.25,0.5), PlotIt=TRUE)

Run the code above in your browser using DataLab