AFQ.utils.stats#

Module Contents#

Functions#

contrast_index(x1, x2[, double])

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

Parameters
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

Returns
contrast_indexndarray of floats

Contrast index calculated by doing (x1 - x2) / (x1 + x2)