AFQ.utils.stats#

Functions#

chunk_indices(indices, num_batches)

contrast_index(x1, x2[, double])

Calculate the contrast index between two arrays.

Module Contents#

AFQ.utils.stats.chunk_indices(indices, num_batches)[source]#
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)