[Mne_analysis] [Freesurfer] question about how to calculate COV for MNE
Joseph Dien
jdien07 at mac.com
Sun Apr 6 23:31:54 EDT 2014
Fair enough! Just trying to understand what Section 6.3 is trying to communicate. So let me try another possible interpretation:
Compute the COV for the two conditions. When subtracting the two conditions, the accompanying COV matrix (same for both conditions since they were pooled when computing it) is divided by Leff. Likewise the accompanying degrees of freedom (used if it is subsequently averaged together with another COV matrix per Section 4.17) is set equal to Leff.
Not saying this is a procedure that makes sense to me either, just asking what the intent is of the MNE developers. Based on your response, this is currently my best guess, although it doesn’t make sense to me either since dividing the COV matrix by a single scalar (however computed) shouldn’t affect computations about relative noise levels in the channels. Basically, I’m not sure what is being done with COV so it’s hard for me to judge what is a reasonable interpretation of Section 6.3.
I appreciate the link to the code, but since I’m a Matlab programmer not a C++ programmer, it’s very hard for me to parse the code. If someone could just tell me what is to be done according to 6.3 when computing a difference wave rather than just what not to do, this would be greatly appreciated. I’m trying to add support for FIFF file format to my Matlab EEG software analysis suite (http://sourceforge.net/projects/erppcatoolkit/) and want to make sure I’m doing it in a manner that would be acceptable to the MNE developers, for the benefit of the users of my package.
Thanks for taking the time to read my question!
Joe
On Apr 5, 2014, at 5:51 AM, Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr> wrote:
> hi joe,
>
>>> I have a question about how to calculate the COV for the MNE software.
>>> As I understand it from Section 4.17 of the 2.7.3 MNE manual, if one is
>>> averaging together COV matrices, one weights them by the number of
>>> observations going into each one. I also see from Section 4.17.2 that these
>>> are technically not covariance matrices so much as sum-of-squares matrices
>>> where the epochs going into each variable has been baseline corrected.
>>>
>>> Assuming my understanding so far is correct, my question is about how to
>>> proceed when making linear combinations of COV matrices, as in a difference
>>> wave, as discussed in Section 6.3. Would the following be the correct
>>> procedure?
>>>
>>> Compute the COV separately for the two conditions (say standard and rare
>>> oddballs). Subtract the two COV matrices to obtain C0.
>
> Subtracting two COV matrices is a bad idea. You can make the new cov
> non positive.
>
> basically the noise cov is just to estimate the noise so any sample you use
> to get a better estimate the better. There is no condition or contrast
> at this stage.
>
> for source reconstruction you should use the same noise cov for the two
> conditions to have the same inverse operator.
>
> you can look at this file to know more about the internals:
>
> https://github.com/mne-tools/mne-python/blob/master/mne/cov.py
>
> HTH
> Alex
>
>
>>> Then calculate C by
>>> dividing by Leff, which in turn is calculated as Leff= (L1*L2)/(L1+L2) where
>>> L1 is the number of observations in the first COV matrix and L2 is for the
>>> second.
>>>
>>> But if done in this way, the two COV matrices would not be weighted by
>>> their relative sample sizes. So would I also weight them by L1 and L2
>>> during the subtraction, as done for averaging per 4.17? But then what is
>>> the purpose of the Leff calculation? Or is the idea that one would calculate
>>> a single COV based on both conditions and then one would modify COV by Leff
>>> to reflect that the signal-to-noise ratio has been reduced by combining two
>>> averages with differing sample sizes? But in the case where both samples
>>> equal, say, 10, Leff would end up equalling 100/20=5. Dividing C by 5 seems
>>> like too much. Anyway, very confused. Any guidance would be appreciated.
>>>
>>> Respectfully,
>>>
>>> Joe
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------------------------
>>>
>>> Joseph Dien,
>>> Senior Research Scientist
>>> Maryland Neuroimaging Center
>>> University of Maryland
>>>
>>> E-mail: jdien07 at mac.com
>>> Phone: 202-297-8117
>>> http://joedien.com
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Freesurfer mailing list
>>> Freesurfer at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom it is
>>> addressed. If you believe this e-mail was sent to you in error and the
>>> e-mail
>>> contains patient information, please contact the Partners Compliance
>>> HelpLine at
>>> http://www.partners.org/complianceline . If the e-mail was sent to you in
>>> error
>>> but does not contain patient information, please contact the sender and
>>> properly
>>> dispose of the e-mail.
>>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
Maryland Neuroimaging Center
University of Maryland
E-mail: jdien07 at mac.com
Phone: 202-297-8117
http://joedien.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140406/d83c4b49/attachment.html
More information about the Mne_analysis
mailing list