Potential depth#

Calculate the potential of the points w.r.t. a multivariate data set. The potential is the kernel-estimated density multiplied by the prior probability of a class. Different from the data depths, a density estimate measures at a given point how much mass is located around it.

Arguments
x: array-like or None, default=None

Matrix of objects (numerical vector as one object) whose depth is to be calculated; each row contains a d-variate point. Should have the same dimension as data.

pretransform: str, default=”1Mom”

The method of data scaling. '1Mom' or 'NMom' for scaling using data moments. '1MCD' or 'NMCD' for scaling using robust data moments (Minimum Covariance Determinant (MCD).

kernel: str, default=”EDKernel”

'EDKernel' for the kernel of type 1/(1+kernel.bandwidth*EuclidianDistance2(x,y)), 'GKernel' [default and recommended] for the simple Gaussian kernel, 'EKernel' exponential kernel: exp(-kernel.bandwidth*EuclidianDistance(x, y)), 'VarGKernel' variable Gaussian kernel, where kernel.bandwidth is proportional to the depth.zonoid of a point.

kernel_bandwidth: int, default=0

the single bandwidth parameter of the kernel. If 0 - the Scott`s rule of thumb is used.

mah_parMcdfloat, default=0.75

Value of the argument alpha for the function covMcd

evaluate_datasetbool, default=False

Determines if dataset loaded will be evaluated. Automatically sets x to dataset

References
  • Pokotylo, O. and Mosler, K. (2019). Classification with the pot-pot plot. Statistical Papers, 60, 903-931.

Examples
>>> import numpy as np
>>> from depth.model import DepthEucl
>>> mat1=[[1, 0, 0],[0, 2, 0],[0, 0, 1]]
>>> mat2=[[1, 0, 0],[0, 1, 0],[0, 0, 1]]
>>> data = np.random.multivariate_normal([0,0,0], mat1, 20)
>>> model=DepthEucl().load_dataset(data)
>>> x = np.random.multivariate_normal([1,1,1], mat2, 10)
>>> model.potential(x,)
[7.51492797 8.34322926 5.42761506 6.25418171 4.25774485 8.09733146
6.65788017 5.11324521 5.74407939 9.26030661]
>>> model.potential(x, kernel_bandwidth=0.1)
[13.56510469 13.95553893 11.23251702 12.42491604 10.17527509 13.70947682
12.67352469 11.2080649  11.73402562 14.93067103]
>>> model.potential(x, pretransform = "NMCD", mah_parMcd=0.6, kernel_bandwidth=0.1)
[11.0603282  11.49509828  8.99303793  8.63168006  7.86456928 11.03588551
10.45468945  8.84989798  9.56799496 12.29832608]