[pymvpa] PDist() - returning correlations > 1

Charlotte Murphy cem552 at york.ac.uk
Thu Jun 4 08:59:53 UTC 2015


Dear all,

The PDist() command should return a correlation distance (-1 to +1),
however when I run the following command I get values outside of this range
(> +1).

# Load in dataset
ds = fmri_dataset(samples = samples, mask = mask, chunks = sa['chunks'],
targets = sa['targets'])
ds = remove_invariant_features(ds)

# mean condition samples
from mvpa2.mappers.fx import mean_group_sample
mtgs = mean_group_sample(['targets'])
mtds = mtgs(ds)

# run PDist() to return correlation distances
dsm = rsa.PDist(square=True)
res = dsm(mtds)

#output
res.samples

array([[ 0.        ,  0.9043133 ,  1.09194786,  1.20181892,  1.2377347
,1.27552916],
       [ 0.9043133 ,  0.        ,  1.31801455,  1.63764293,  0.84023813,
1.26055982],
       [ 1.09194786,  1.31801455,  0.        ,  1.204598  ,  1.52931203,
0.97232624],
       [ 1.20181892,  1.63764293,  1.204598  ,  0.        ,  1.03952873,
0.90664715],
       [ 1.2377347 ,  0.84023813,  1.52931203,  1.03952873,  0.
 ,1.51721574],
       [ 1.27552916,  1.26055982,  0.97232624,  0.90664715,  1.51721574, 0.
       ]])


Any idea what I am doing wrong? From the documentation online (
http://www.pymvpa.org/generated/mvpa2.measures.rsa.pdist.html) the function
PDist() by default(?) calculates the Euclidean distance, although the
documentation on the RSA page (http://www.pymvpa.org/examples/rsa_fmri.html)
states that the PDist calculates correlation distance - could this be where
I am going wrong? I have tried explicitly calling in metric = 'correlation'
but this results in and 'Unexpected keyword argument' error message.

Cheers,
Charlotte


-- 
Charlotte Murphy
PhD Student
Department of Psychology
University of York,
Heslington, York, YO10 5DD, UK
Email: cem552 at york.ac.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20150604/f386252c/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list