You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently there is an issue with whitening and cov computation if multiple SSSed runs are considered in which the numbe of components dffer. Let's say over 10 runs we have a component range of 67-71 and then compute the covariance on epochs that include data from all these runs. The covariance spectrum would indicate a rank of 91, irrespective of the method used (e.g. empirical), but clearly the resulting whitening would look inappropriate. Contrastingly, when computed runwise, the rank of the cov would reflect the number of SSS components in that run.
indeed the intuition is that the head position is different for each run so
the SSS signal subspace is sightly different and artificially increases the
numerical rank of the data.
not sure what to do in this case besides allowing to specify the rank
manually. Or fix head position...
@Eric89GXL @agramfort@dengemann
This seems plausible indeed: I get an issue as soon as I concatenate two runs, even if I estimate the covariance on the trials of the first run (although estimating the covariance on the first run alone is ok). I'll check it out. Thanks!
We re-analyzed the data after having used the SSS realignement. The issue remains though. Interestingly the whitening looks correct if the cov and the evoked are computed on 10% of the trials across all runs. So combining across runs does not seem to be the issue anymore but using all trials (~1900). Any thoughts, ideas, anyone?
Try calculating it on 10% of the trials (190), versus 10 copies of those 10% of trials (total 1900). It's possible this is a numerical precision issue that starts appearing with accumulation or something.
I'm confused -- I thought that the whitening matrix was entirely determined by the covariance matrix (assuming the selection of channels is identical). If that's true, it implies something about your average actually being different.
I think @Eric89GXL is right. The data I was playing with were bandpass filtered a .75 - 35 Hz.
I retried with just a lowpass at 35Hz + baseline on the first 200 ms after epoch onset (stim comes 430 ms after epoch onset), and it gets a little better on the 1900 epochs average:
the problem with this baselining is that it induces these late, probably
spurious, components. Not sure this looks so much better. I think the
butterfy plot used to look better before. With 1900 we might have to live
with the fact that we find non-Gaussian processes in the baseline that
cannot be whitened away. To be discussed.
I retried with just a lowpass at 35Hz + baseline on the first 200 ms after
epoch onset (stim comes 430 ms after epoch onset), and it gets a little
better on the 1900 epochs average:
I think we're having a "funny" dataset, with ~2000 trials SNR is so high
that extremelt weak phase sustained time-locked become visible. Not 100%
sure this is really the case though, but currently the best supported
interpretation given the evidence.
Coming back to the original point about combining SSS runs, a similar problem happens with maxwell_filter when doing movement compensation with regularization. There are two problems actually:
There are some edge artifacts at head-position boundaries.
The number of components varies as a function of time.
Point (1) is usually minor, but there are ways to fix it and I plan to do so soon.
Point (2) is harder but seems to be fixed quite nicely by mne.cov.regularize. Things like "shrunk" and "factor_analysis" are not as robust to such data with a time-varying number of components AFAICT.
I am tempted to recommend that poeple use mne.cov.regularize when dealing with data that have been processed with MNE-Python's movement compensation algorithm. Thoughts @agramfort@dengemann ?
Point (2) is harder but seems to be fixed quite nicely by
mne.cov.regularize. Things like "shrunk" and "factor_analysis" are not as
robust to such data with a time-varying number of components AFAICT.
can you tell us more? what do you get when using auto mode? what values do
you use with mne.cov.regularize?
am tempted to recommend that poeple use mne.cov.regularize when dealing with data that have been processed with MNE-Python's movement compensation algorithm.
Ok time for action. We should not regress back to mne.cov.regularize. I'm optimistic that we can elaborate a solution to this problem.
can you tell us more? what do you get when using auto mode? what values do
you use with mne.cov.regularize?
For data with time-varying rank or spatial structure, the ECD localization bias is about the same as when using an empirical noise covariance, which is 2+ cm localization bias on phantom data that is ~1mm bias with regularized cov. I think it's due to small non-zero eigenvalues. In other words, I think the automated methods are producing a "correct" result, in the sense that it is rightfully producing some small non-zero eigenvalues corresponding to the chunks of data that are only present part of the time. However those small eigenvalues effectively break the whitening step. I suspect those methods are meant to be used for data with spatially stationary noise processes or at least data with constant rank, and movement-compensated data with time-varying regularization (or other data with similar time-varying structure) will likely not work.
I can try to simulate some simple data to show this effect.
what values do you use with mne.cov.regularize?
The defaults. It probably doesn't matter much so long as the eigenvalues are prevented from getting too small during whitening.
I don't see why our approach should not be able to learn the right amount
of regularization if correctly parametrized. Maybe we need to chat on some
of our channels these days.
On Wed, 21 Dec 2016 at 15:40, Eric Larson ***@***.***> wrote:
what do you get when using auto mode?
For data with time-varying rank or spatial structure, the ECD localization
bias is about the same as when using an empirical noise covariance, which
is 2+ cm localization bias on phantom data that is ~1mm bias with
regularized cov. I think it's due to small non-zero eigenvalues. In other
words, I think the automated methods are producing a "correct" result, in
the sense that it is rightfully producing some small non-zero eigenvalues
corresponding to the chunks of data that are only present part of the time.
However those small eigenvalues effectively break the whitening step. I
suspect those methods are meant to be used for data with spatially
stationary noise processes or at least data with constant rank, and
movement-compensated data with time-varying regularization (or other data
with similar time-varying structure) will likely not work.
I can try to simulate some simple data to show this effect.
what values do you use with mne.cov.regularize?
The defaults. It probably doesn't matter much so long as the eigenvalues
are prevented from getting too small during whitening.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1902 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB0fiugHrsvG8M2h6kn3dA4NBjsN-Cyyks5rKTppgaJpZM4Dz-OA>
.
Yes I'v sat together with JR when filing the issue. My point is that if we
understand now better what's the matter we can eventually handle it, the
autocov may need a different handling here.
(FWIW & from what I remember, shrunk covariance solved the problem in most subjects. However the issue was originally due to distinct dev_head_t + high number of trials.)
Activity
larsoner commentedon Mar 24, 2015
I take it the runs were not translated into the same head position?
agramfort commentedon Mar 24, 2015
dgwakeman commentedon Mar 24, 2015
I assume the noise is so bad that SSS is necessary (personally, I avoid it and try to stick with SSPs as much as possible).
kingjr commentedon Mar 24, 2015
@Eric89GXL @agramfort @dengemann
This seems plausible indeed: I get an issue as soon as I concatenate two runs, even if I estimate the covariance on the trials of the first run (although estimating the covariance on the first run alone is ok). I'll check it out. Thanks!
kingjr commentedon Mar 24, 2015
Yep, head positions were not translated to a common head position... I just need to find a maxfilter licence now...
Thanks again!
[-]FIX: whitening / rank issue when combining [/-][+]FIX: whitening issue when combining [/+][-]FIX: whitening issue when combining [/-][+]FIX: whitening issue when combining runs[/+]dengemann commentedon Apr 16, 2015
We re-analyzed the data after having used the SSS realignement. The issue remains though. Interestingly the whitening looks correct if the cov and the evoked are computed on 10% of the trials across all runs. So combining across runs does not seem to be the issue anymore but using all trials (~1900). Any thoughts, ideas, anyone?
@agramfort @Eric89GXL
kingjr commentedon Apr 16, 2015
Here s is the report for the 1900 epochs:
https://dl.dropboxusercontent.com/u/3518236/1900_epochs.html
and here for 190:
https://dl.dropboxusercontent.com/u/3518236/190_epochs.html
larsoner commentedon Apr 16, 2015
Try calculating it on 10% of the trials (190), versus 10 copies of those 10% of trials (total 1900). It's possible this is a numerical precision issue that starts appearing with accumulation or something.
kingjr commentedon Apr 16, 2015
@Eric89GXL Copying 10 times 10% of the trials looks fine (i.e. it's similar case to the
evoked=epochs[::10].averagescenario)larsoner commentedon Apr 16, 2015
So that makes it less likely to be an accumulation error... weird.
The eigenvalue plots and covariance plots for the two links above look pixel-for-pixel identical to me, I think there was a plotting error.
dengemann commentedon Apr 16, 2015
@Eric89GXL this is because it's the same covariance in both cases. The cov seems fine, something is to be understood about the averaging / whitening.
larsoner commentedon Apr 16, 2015
I'm confused -- I thought that the whitening matrix was entirely determined by the covariance matrix (assuming the selection of channels is identical). If that's true, it implies something about your average actually being different.
dengemann commentedon Apr 16, 2015
@Eric89GXL what we have is:
something is really weird here.
14 remaining items
kingjr commentedon Apr 17, 2015
I think @Eric89GXL is right. The data I was playing with were bandpass filtered a .75 - 35 Hz.
I retried with just a lowpass at 35Hz + baseline on the first 200 ms after epoch onset (stim comes 430 ms after epoch onset), and it gets a little better on the 1900 epochs average:
https://dl.dropboxusercontent.com/u/3518236/report_Filter_0_35Hz.html
It's still not perfect though...
dengemann commentedon Apr 17, 2015
the problem with this baselining is that it induces these late, probably
spurious, components. Not sure this looks so much better. I think the
butterfy plot used to look better before. With 1900 we might have to live
with the fact that we find non-Gaussian processes in the baseline that
cannot be whitened away. To be discussed.
2015-04-17 9:43 GMT+02:00 J-R King [email protected]:
agramfort commentedon Apr 20, 2015
dengemann commentedon Apr 20, 2015
I think we're having a "funny" dataset, with ~2000 trials SNR is so high
that extremelt weak phase sustained time-locked become visible. Not 100%
sure this is really the case though, but currently the best supported
interpretation given the evidence.
2015-04-20 13:50 GMT+02:00 Alexandre Gramfort [email protected]:
larsoner commentedon Dec 20, 2016
Coming back to the original point about combining SSS runs, a similar problem happens with
maxwell_filterwhen doing movement compensation with regularization. There are two problems actually:There are some edge artifacts at head-position boundaries.
The number of components varies as a function of time.
Point (1) is usually minor, but there are ways to fix it and I plan to do so soon.
Point (2) is harder but seems to be fixed quite nicely by
mne.cov.regularize. Things like "shrunk" and "factor_analysis" are not as robust to such data with a time-varying number of components AFAICT.I am tempted to recommend that poeple use
mne.cov.regularizewhen dealing with data that have been processed with MNE-Python's movement compensation algorithm. Thoughts @agramfort @dengemann ?agramfort commentedon Dec 21, 2016
dengemann commentedon Dec 21, 2016
Ok time for action. We should not regress back to mne.cov.regularize. I'm optimistic that we can elaborate a solution to this problem.
yes please!
larsoner commentedon Dec 21, 2016
For data with time-varying rank or spatial structure, the ECD localization bias is about the same as when using an empirical noise covariance, which is 2+ cm localization bias on phantom data that is ~1mm bias with regularized cov. I think it's due to small non-zero eigenvalues. In other words, I think the automated methods are producing a "correct" result, in the sense that it is rightfully producing some small non-zero eigenvalues corresponding to the chunks of data that are only present part of the time. However those small eigenvalues effectively break the whitening step. I suspect those methods are meant to be used for data with spatially stationary noise processes or at least data with constant rank, and movement-compensated data with time-varying regularization (or other data with similar time-varying structure) will likely not work.
I can try to simulate some simple data to show this effect.
The defaults. It probably doesn't matter much so long as the eigenvalues are prevented from getting too small during whitening.
dengemann commentedon Dec 21, 2016
larsoner commentedon Dec 21, 2016
@dengemann you originally reported the same problem over a year and a half ago... surely you've seen this problem, too?
dengemann commentedon Dec 21, 2016
kingjr commentedon Dec 21, 2016
(FWIW & from what I remember, shrunk covariance solved the problem in most subjects. However the issue was originally due to distinct dev_head_t + high number of trials.)
larsoner commentedon Apr 4, 2018
Moved to #3985, closing here