Manly.plot: Density plot or contour plot for Manly mixture model

View source: R/other.R

Manly.plotR Documentation

Density plot or contour plot for Manly mixture model

Description

Provides a contour plot or a density plot for the fitted data with Manly mixture model.

Usage

Manly.plot(X, var1 = NULL, var2 = NULL, model = NULL, x.slice = 100, 
y.slice = 100, x.mar = 1, y.mar = 1, col = "lightgrey", ...)

Arguments

X

dataset matrix (n x p)

var1

x-axis variable for contour plot or variable for density plot

var2

y-axis variable for contour plot

model

fitted Manly mixture model

x.slice

number of slices in the first variable sequence in the contour

y.slice

number of slices in the second variable sequence in the contour

x.mar

value to be subtracted/added to the smallest/largest observation in the x-axis

y.mar

value to be subtracted/added to the smallest/largest observation in the y-axis

col

color of the contour lines

...

further arguments related to contour and hist

Details

Provides the contour plot or density plot for the fitted data by Manly mixture model.

See Also

Manly.EM

Examples


set.seed(123)

K <- 2; p <- 2
X <- as.matrix(faithful)

# Obtain initial memberships based on the K-means algorithm
id.km <- kmeans(X, K)$cluster

# Run the EM algorithm for a Manly mixture model based on K-means solution
la <- matrix(0.1, K, p)
B <- Manly.EM(X, id.km, la)

Manly.plot(X, model = B, var1 = 1, x.mar = 1, y.mar = 2,
xaxs="i", yaxs="i", xaxt="n", yaxt="n", xlab="", 
ylab = "", nlevels = 10, drawlabels = FALSE, 
lwd = 3.2, col = "lightgrey", pch = 19)


ManlyMix documentation built on April 29, 2023, 9:17 a.m.