D-prime (d_prime
)¶
Calculation¶
D-prime uses linear discriminant analysis (LDA) to estimate the classification accuracy between two units.
\(v\) denotes a waveform.
\(C\) denotes the class (unit) for which the metric is being calculated.
\(D\) denotes the set of spikes which are not in \(C\).
\(P(v|C)\) probability distributions are assumed to be Gaussian.
LDA is fit to spikes in \(C\), then to spikes in \(D\).
\(\mu_C^{(LDA)}\) and \(\mu_D^{(LDA)}\) denote the mean of the LDA for clusters \(C\) and \(D\) respectively.
\(\sigma_C^{(LDA)}\) and \(\sigma_D^{(LDA)}\) denote the standard deviation of the LDA for clusters \(C\) and \(D\) respectively.
D-prime is then calculated as follows:
Expectation and use¶
D-prime is a measure of cluster separation, and will be larger in well separated clusters.
Example code¶
import spikeinterface.qualitymetrics as sqm
d_prime = sqm.lda_metrics(all_pcs=all_pcs, all_labels=all_labels, this_unit_id=0)
Reference¶
- spikeinterface.qualitymetrics.pca_metrics.lda_metrics(all_pcs, all_labels, this_unit_id)¶
Calculates d-prime based on Linear Discriminant Analysis.
- Parameters
- all_pcs2d array
The PCs for all spikes, organized as [num_spikes, PCs].
- all_labels1d array
The cluster labels for all spikes. Must have length of number of spikes.
- this_unit_idint
The ID for the unit to calculate these metrics for.
- Returns
- d_primefloat
D prime measure of this unit.
References
Based on metric described in [Hill]
Literature¶
Introduced by [Hill].