Partition plot for kernel density clustering
Plot of partition for kernel density clustering for 2-dimensional data.
mvnorm.mixt.part(mus, Sigmas, props=1, xmin, xmax, gridsize, max.iter=100, verbose=FALSE) kms.part(x, H, xmin, xmax, gridsize, verbose=FALSE, ...) ## S3 method for class 'kde.part' plot(x, display="filled.contour", col, add=FALSE, ...)
mus |
(stacked) matrix of mean vectors |
Sigmas |
(stacked) matrix of variance matrices |
props |
vector of mixing proportions |
xmin,xmax |
vector of minimum/maximum values for grid |
gridsize |
vector of number of grid points |
max.iter |
maximum number of iterations |
verbose |
flag to print out progress information. Default is FALSE. |
x |
matrix of data values or an object of class |
H |
bandwidth matrix. If missing,
|
display |
type of display, "slice" for contour plot, "persp" for perspective plot, "image" for image plot, "filled.contour" for filled contour plot (1st form), "filled.contour2" (2nd form) |
col |
vector of plotting colours |
add |
flag to add to current plot. Default is FALSE. |
... |
other parameters |
For 2-d data, kms.part
and mvnorm.mixt.part
produce a
kde.part
object whose
values are the class labels, rather than probability density values.
A kernel partition is an object of class kde.part
which is a
list with fields:
x |
data points - same as input |
eval.points |
vector or list of points at which the estimate is evaluated |
estimate |
density estimate at |
H |
bandwidth matrix |
gridtype |
"linear" |
gridded |
flag for estimation on a grid |
binned |
flag for binned estimation |
names |
variable names |
w |
vector of weights |
cont |
vector of probability contour levels |
end.points |
matrix of final iterates starting from |
label |
vector of cluster labels |
mode |
matrix of cluster modes |
nclust |
number of clusters |
nclust.table |
frequency table of cluster labels |
tol.iter,tol.clust,min.clust.size |
tuning parameter values - same as input |
Plot is sent to graphics window.
## normal mixture partition mus <- rbind(c(-1,0), c(1, 2/sqrt(3)), c(1,-2/sqrt(3))) Sigmas <- 1/25*rbind(invvech(c(9, 63/10, 49/4)), invvech(c(9,0,49/4)), invvech(c(9,0,49/4))) props <- c(3,3,1)/7 nmixt.part <- mvnorm.mixt.part(mus=mus, Sigmas=Sigmas, props=props) plot(nmixt.part, asp=1, xlim=c(-3,3), ylim=c(-3,3)) ## kernel mean shift partition if (interactive()) { set.seed(81928192) x <- rmvnorm.mixt(n=1000, mus=mus, Sigmas=Sigmas, props=props) msize <- round(151^2*0.05) kms.nmixt.part <- kms.part(x=x, min.clust.size=msize) plot(kms.nmixt.part, asp=1, xlim=c(-3,3), ylim=c(-3,3))}
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.