The arguments “alphaX”, “alphaY” of the function “clover_calc” determine which upper level set of the halfspace depth should be used for the X and Y samples for computing the illuminations. By default the median of empirical depth values is used.

Example

First we generate data from bivariate normal distributions with different means and the same variance matrices and compute the necessary quantities, with the default value of “alphaX” and “alphaY”. Note that the actual values are reported in the text output of the function “clover_calc”, together with the fraction of points from the given sample lying in the central region:

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)
## Computing values to be plotted.
## Status:0
## Status:0
## Computing boundary curves.
## Computing classifications.
## Computing number of ties.
## Done.
## 
## Central regions used for computing the illuminations are based on the following quantities:
## alphaX =  0.12
## alphaY =  0.1067
## Fraction of points in sample X with halfspace depth >= alphaX:  0.53
## Fraction of points in sample Y with halfspace depth >= alphaY:  0.52

Now larger values of “alphaX” and “alphaY” are used, resulting in smaller central regions. The values are again reported in the text output, together with the fraction of points from the given sample lying in the central region:

res2 <- clover_calc(X, Y, alphaX=0.2, alphaY=0.2)
## Computing values to be plotted.
## Status:0
## Status:0
## Computing boundary curves.
## Computing classifications.
## Computing number of ties.
## Done.
## 
## Central regions used for computing the illuminations are based on the following quantities:
## alphaX =  0.2
## alphaY =  0.2
## Fraction of points in sample X with halfspace depth >= alphaX:  0.24
## Fraction of points in sample Y with halfspace depth >= alphaY:  0.253

The data (in two dimensions) can be plotted together with the central regions:

clover_plot_data(res)
clover_plot_data(res2)

The clover plots will differ only in quadrant III (the central regions are used for computing the illuminations):

clover_plot(res)
## 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
clover_plot(res2)
## 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.