[pymvpa] correlation between 2 matrices

Brian Murphy brian.murphy at qub.ac.uk
Fri Oct 28 19:58:45 UTC 2016


If I understand your query correctly, I think numpy could do it, first 
by flattening the matrices to simple vectors, and then calculating the 
correlation between those, e.g.

np.corrcoef(np.array(matrix1).flatten(), np.array(matrix2).flatten())

... assuming you're using the matrix datatype. If they are vanilla 2D 
arrays, then you shouldn't need to recast:

np.corrcoef(matrix1.flatten(), matrix2.flatten())

best,

Brian


On 28/10/16 20:44, David Soto wrote:
> hi,
>
> I wonder whether PyMVPA can compute a similarity index (correlation) 
> between two 2D matrices, each comprised of 12 seconds & 300 voxels?
>
> thanks!
> david
>
>
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20161028/8e9b3784/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list