Learn R Programming

MixSim (version 1.0-2)

pdplot: Parallel Distribution Plot

Description

Constructs a parallel distribution plot for Gaussian finite mixture models

Usage

pdplot(Pi, Mu, S, file = NULL, Nx = 5, Ny = 5, MaxInt = 1, marg = c(2,1,1,1))

Arguments

Pi
vector of mixing proprtions
Mu
matrix consisting of components' mean vectors (K x p)
S
set of components' covariance matrices (p x p x K)
file
name of .pdf-file
Nx
number of color levels for smoothing along the x-axis
Ny
number of color levels for smoothing along the y-axis
MaxInt
maximum color intensity
marg
plot margins

Details

If 'file' is specified, produced plot will be saved as a .pdf-file

References

Maitra, R. and Melnykov, V. (2010) "Simulating data to study performance of finite mixture modeling and clustering algorithms", The Journal of Computational and Graphical Statistics, 2:19, 354-376.

See Also

MixSim, overlap, simdataset

Examples

Run this code
data(iris)

K <- 3
p <- dim(iris)[2] - 1
n <- dim(iris)[1]
id <- as.numeric(iris[,5])
Pi <- NULL
Mu <- NULL
S <- array(rep(0, p * p * K), c(p, p, K))

# estimate mixture parameters
for (k in 1:K){
	Pi <- c(Pi, sum(id == k) / n)
	Mu <- rbind(Mu, apply(iris[id == k,-5], 2, mean))
	S[,,k] <- var(iris[id == k,-5])
}

pdplot(Pi = Pi, Mu = Mu, S = S)

Run the code above in your browser using DataLab