plot.rimle: Plot Methods for RIMLE Objects

Description Usage Arguments Value References Author(s) See Also Examples

View source: R/plotting.R

Description

Plot robust model-based clustering results: scatter plot with clustering information and cluster fit.

Usage

1
2
3
## S3 method for class 'rimle'
plot(x, what=c("fit", "clustering"),
     data=NULL, margins=NULL, cluster=NULL, ...)

Arguments

x

Output from rimle

what

The type of graph. It can be one of the following: "fit" (default), "clustering". See Details.

data

The data vector, matrix or data.frame (or some transformation of them), used for obtaining the 'rimle' object. This is only relevant if what="clustering".

margins

A vector of integers denoting the variables (numbers of columns of data) to be used for a pairs-plot if what="clustering". When margins=NULL it is set to 1:ncol(data) (default).

cluster

An integer denoting the cluster for which the fit plot is returned. This is only relevant if what="fit".

...

further arguments passed to or from other methods.

Value

If what="fit"

The P-P plot (probability-probability plot) of the weighted empirical distribution function of the Mahalanobis distances of observations from clusters' centers against the target distribution. The target distribution is the Chi-square distribution with degrees of freedom equal to ncol(data). The weights are given by the improper posterior probabilities. If cluster=NULL P-P plots are produced for all clusters, otherwise cluster selects a single P-P plot at times.

If what="clustering"

A pairwise scatterplot with cluster memberships. Points assigned to the noise/outliers component are denoted by '+'.

References

Coretto, P. and C. Hennig (2016). Robust improper maximum likelihood: tuning, computation, and a comparison with other methods for robust Gaussian clustering. Journal of the American Statistical Association, Vol. 111(516), pp. 1648-1659. doi: 10.1080/01621459.2015.1100996

P. Coretto and C. Hennig (2017). Consistency, breakdown robustness, and algorithms for robust improper maximum likelihood clustering. Journal of Machine Learning Research, Vol. 18(142), pp. 1-39. https://jmlr.org/papers/v18/16-382.html

Author(s)

Pietro Coretto pcoretto@unisa.it https://pietro-coretto.github.io

See Also

otrimle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Load  Swiss banknotes data
data(banknote)
x <- banknote[,-1]

## Perform rimle clustering with default arguments
set.seed(1)
a <- rimle(data = x, G = 2)
print(a)

## Plot clustering
plot(a, data = x, what = "clustering")

## Plot clustering on selected margins
plot(a, data = x, what = "clustering", margins = 4:6)

## Plot clustering on the first two principal components
z <- scale(x) %*%   eigen(cor(x), symmetric = TRUE)$vectors
colnames(z) <- paste("PC", 1:ncol(z), sep = "")
plot(a, data = z, what = "clustering", margins = 1:2)

## Fit plot for all clusters
plot(a, what = "fit")

## Fit plot for cluster 1
plot(a, what = "fit", cluster = 1)

Example output

OTRIMLE: Robust Model-Based Clustering
Type 'citation("otrimle")' for citing this R package in publications.


RIMLE with fixed logicd=-10.62114 discovered G=2 clusters plus noise of size:

    Noise Cluster.1 Cluster.2 
       15       100        85 

Available components:
code, flag, iter, logicd, iloglik, criterion, npr, cpr, mean, cov, tau, smd, cluster, size

otrimle documentation built on May 29, 2021, 9:09 a.m.

Related to plot.rimle in otrimle...