-
Notifications
You must be signed in to change notification settings - Fork 141
Description
I recently did a simulation and realized that brainiak SRM can't align two trajectories that different by a vector shift, though probabilistic SRM should be able to align them by estimating the correct mu.
Here's the notebook containing the simulation. By commenting/uncommenting some code block, the notebook can show that
i) the shifting can be fixed by doing mean centering 1st
ii) SRM can fix rotational difference (i.e. trajectory 2 = some orthogonal transformation of trajectory 1), as expected
@cameronphchen thinks there is a bug. Here's what he said:
"
I think this might be due to this line
brainiak/brainiak/funcalign/srm.py
Line 263 in efce8ae
| s[subject] = self.w_[subject].T.dot(X[subject]) |
In the implementation, because fMRI data is usually preprocessed by z-scoring, seems like the re-centering part wasn't properly taken care of. If you change the above line to be W^T(X-mu), you should be able to get the expected results.
"
We tried it, which indeed fixed the issue. I can make a PR later, but thought I would make a note first.