Calculate the contrast index between two arrays.
- AFQ.utils.stats.contrast_index(x1, x2, double=True)[source]#
Calculate the contrast index between two arrays. The contrast index is symmetrical with respect to the choice of the baseline for comparison
- x1ndarray of floats
An ndarray to compare. The contrast index will have positive values where x1 > x2.
- x2ndarray of floats
An ndarray to compare. The contrast index will have negative values where x2 > x1.
- doublebool, optional
Double the contrast index. This makes it comparable to a percent difference. Default: True
- contrast_indexndarray of floats
Contrast index calculated by doing (x1 - x2) / (x1 + x2)