Simplicial volume depth#
- DepthEucl.simplicialVolume(x: ndarray | None = None, exact: bool = True, k: float = 0.05, mah_estimate: str = 'moment', mah_parMCD: float = 0.75, evaluate_dataset: bool = False) ndarray [source]
Calculates the simpicial volume depth of points w.r.t. a multivariate data set.
- 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.
- exactbool, default=True
exact=True
(by default) implies the exact algorithm,exact=False
implies the approximative algorithm, considering k simplices.- k: float or int, default=0.05
- Number (
k > 1
) or portion (if0 < k < 1
) of simplices that are considered ifexact = F
.Ifk > 1
, then the algorithmic complexity is polynomial in d but is independent of the number of observations in data, given k.If0 < k < 1
, then the algorithmic complexity is exponential in the number of observations in data, but the calculation precision stays approximately the same. - mah_estimatestr, {“moment”, “mcd”}, default=”moment”
A character string specifying which estimates to use when calculating the Mahalanobis depth; can be “‘moment’” or
'MCD'
, determining whether traditional moment or Minimum Covariance Determinant (MCD) estimates for mean and covariance are used.- mah_parMcdfloat, default=0.75
is the value of the argument alpha for the function covMcd; is used when mah.estimate =
'MCD'
.- evaluate_datasetbool, default=False
Determines if dataset loaded will be evaluated. Automatically sets x to dataset
- References
Oja, H. (1983). Descriptive statistics for multivariate distributions. Statistics and Probability Letters, 1, 327–332.
- 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]] >>> x = np.random.multivariate_normal([1,1,1], mat2, 10) >>> data = np.random.multivariate_normal([0,0,0], mat1, 20) >>> model=DepthEucl().load_dataset(data) >>> model.simplicalVolume(x, exact=True) [0.45749049 0.34956166 0.2263421 0.68742137 0.94796538 0.51112415 0.85250931 0.67914988 0.79165292 0.33192247] >>> model.simplicalVolume(x, exact=False, k=0.2) [0.46826813 0.40138917 0.23189724 0.69025277 0.938543 0.56005713 0.8113647 0.72220103 0.82036139 0.33908597]