mvpa2.clfs.distance.one_minus_correlation

mvpa2.clfs.distance.one_minus_correlation(X, Y)

Return one minus the correlation matrix between the rows of two matrices.

This functions computes a matrix of correlations between all pairs of rows of two matrices. Unlike NumPy’s corrcoef() this function will only considers pairs across matrices and not within, e.g. both elements of a pair never have the same source matrix as origin.

Both arrays need to have the same number of columns.

Parameters:

X: 2D-array

Y: 2D-array

Examples

>>> import numpy as np
>>> from mvpa2.clfs.distance import one_minus_correlation
>>> X = np.random.rand(20,80)
>>> Y = np.random.rand(5,80)
>>> C = one_minus_correlation(X, Y)
>>> print C.shape
(20, 5)