The argument “jitter” of the function “clover_plot” determines if jittering should be applied to all points in quadrant I (DD plot where ties often occur, resulting in overlapping points) and point [0,0] in quadrant III (plot of illuminations, in case of overlapping central regions some points may have illumination equal to 1 - plotted as 0 - w.r.t. both samples). The default value is FALSE.

Tied values may occur in the clover plot (i.e. several observations may share the same coordinates in one of the quadrants of the clover plot). To address this issue the hovering tooltip information contains the line “ties: k1 / k2”, where k1 is the number of observations from class 1 (sample X) having this coordinates in the given quadrant and k2 is the number of observations from class 2 (sample Y) having this coordinates in the given quadrant.

Adding jitter to these tied points makes it possible to separate the points visually and determine their index in the hovering tooltip information. The amount of jitter is chosen automaticaly so that ties are broken in each coordinate of the DD plot but the ordering of distinct values is preserved in each coordinate.

Regarding jitter, the most interesting point is the point [0,0] in the DD-plot. Hence a bounding rectangle is plotted around this point so that all points having zero depth w.r.t. both samples are easily identified.

Example

First we generate data from bivariate normal distributions with different means and the same variance matrices and compute the necessary quantities:

library(mvtnorm)

n1 <- 100
n2 <- 75

set.seed(2020)

X <- rmvnorm(n1, mean=c(0,0), sigma=diag(2)) # Observations of class 1
Y <- rmvnorm(n2, mean=c(2,2), sigma=diag(2)) # Observations of class 2

res <- clover_calc(X, Y)

The clover plot with jitter (zoom in to see e.g. the point [0,0] in the DD-plot in detail):

clover_plot(res, jitter=TRUE)
## Misclassification rate of the QDA classifier:   0.0857
## Non-classification rate of the QDA classifier:  0
## 
## Misclassification rate of the DD1 classifier:   0.0914
## Non-classification rate of the DD1 classifier:  0.0686

The clover plot without jitter:

clover_plot(res, jitter=FALSE)
## Misclassification rate of the QDA classifier:   0.0857
## Non-classification rate of the QDA classifier:  0
## 
## Misclassification rate of the DD1 classifier:   0.0914
## Non-classification rate of the DD1 classifier:  0.0686

Back to the main page.