- C : cluster of interest.
- N_s : number of spikes within cluster C.
- N_n : number of spikes outside of cluster C.
- N_{min} : minimum of N_s and N_n.
- \mu_C, \Sigma_C : mean vector and covariance matrix for spikes within C (where each spike within C is represented by a vector of principal components (PCs)).
- D_{i,C}^2 : for every spike i (represented by vector x_i) outside of cluster C, the Mahalanobis distance (as below) between \mu_c and x_i is calculated. These distances are ordered from smallest to largest. The N_{min}'th entry in this list is the isolation distance.
D_{i,C}^2 = (x_i - \mu_C)^T \Sigma_C^{-1} (x_i - \mu_C)
Geometrically, the isolation distance for cluster C is the radius of the circle which contains N_{min} spikes from cluster C and N_{min} spikes outside of the cluster C.
Isolation distance can be interpreted as a measure of distance from the cluster to the nearest other cluster. A well isolated unit should have a large isolation distance.
.. autofunction:: spikeinterface.qualitymetrics.pca_metrics.mahalanobis_metrics
Introduced by [Harris]_.