Learn R Programming

MixSim (version 0.1-01)

pdplot: Parallel Distribution Plot

Description

Constructs a parallel distribution plot for a Gaussian finite mixture model

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 x-axis
Ny
number of color levels for smoothing along 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. (200?) "Simulating data to study performance of finite mixture modeling and clustering algorithms", The Journal of Computational and Graphical Statistics.

Davies, R. (1980) "The distribution of a linear combination of chi-square random variables", Applied Statistics, 29, 323-333.

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