# EEG reference for covariance matrices

**URL:** <https://mne.discourse.group/t/eeg-reference-for-covariance-matrices/114>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 16, 2009, 4:33pm UTC](https://mne.discourse.group/t/eeg-reference-for-covariance-matrices/114 "2009-04-16T16:33:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 16, 2009, 4:33pm UTC](https://mne.discourse.group/t/eeg-reference-for-covariance-matrices/114/1 "2009-04-16T16:33:21Z")

</div>

Dear all,

We have a question regarding the computation of covariance matrices with  
EEG and MEG in MNE:

The inverse is always computed on the average reference data (for EEG).  
Therefore the covariance matrices should be computed on the average  
reference too. Although the inverse solution, theoretically, does not  
depend on the choice of reference electrode, one has to make sure that  
the leadfield, covariance matrix, and data are referenced in the same  
way when performing the computations in MNE. Apparently, MNE always uses  
average reference for the leadfield and the data, but not necessarily  
for the covariance matrices.  
This means that we have to use the option --projon when we are computing  
the covariance matrices with mne\_process\_raw.  
If we use the --projoff option, then the covariance matrices are  
computed with the acquisition reference, and therefore, the inverse  
solution will be incorrect.

Are we right?

Thanks in advance for your answer,

Elisabeth

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 16, 2009, 4:49pm UTC](https://mne.discourse.group/t/eeg-reference-for-covariance-matrices/114/2 "2009-04-16T16:49:50Z")

</div>

Hi Elisabeth,

> Dear all,
> 
> We have a question regarding the computation of covariance matrices  
> with EEG and MEG in MNE:
> 
> The inverse is always computed on the average reference data (for  
> EEG).  
> Therefore the covariance matrices should be computed on the average  
> reference too. Although the inverse solution, theoretically, does  
> not depend on the choice of reference electrode, one has to make  
> sure that the leadfield, covariance matrix, and data are referenced  
> in the same way when performing the computations in MNE. Apparently,  
> MNE always uses average reference for the leadfield and the data,  
> but not necessarily for the covariance matrices.  
> This means that we have to use the option --projon when we are  
> computing the covariance matrices with mne\_process\_raw.  
> If we use the --projoff option, then the covariance matrices are  
> computed with the acquisition reference, and therefore, the inverse  
> solution will be incorrect.
> 
> Are we right?

You are bringing up an important point. However, this is automatically  
accounted for in MNE.

The average reference is equivalent to a projection operator. When the  
inverse operator is put together, this projection is automatically  
applied to the noise covariance matrix as well. Therefore, it is OK to  
leave the projection off when the noise covariance matrix is computed.

Incidentally, I have found that sometimes the (for reasons I do not  
exactly know) the EEG noise covariance is not as "good" when you look  
at its eigenvalue spectra as the MEG one. Therefore, especially when  
computing combined MEG/EEG estimates I usually regularize the noise  
covariance using --megreg 0.1 and --eegreg 0.1 options to  
mne\_do\_inverse\_operator.

I hope this helps,  
Matti

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 27, 2009, 3:30pm UTC](https://mne.discourse.group/t/eeg-reference-for-covariance-matrices/114/3 "2009-04-27T15:30:13Z")

</div>

Hello !

I'm currently using the function mne\_make\_combined\_event\_file from the mne  
matlab toolbox. This function gets the time of an event on a specified  
channel and put it in a text file. But I've noticed that it doesn't get the  
onset of the event but the offset of this event (the time when the channel  
goes back to zero).  
Why is that ? Is there any reason to look at the offset instead of the onset  
?

Thanks in advance,

Lucie

2009/4/16 Matti Hamalainen \<msh at nmr.mgh.harvard.edu\>

> Hi Elisabeth,
> 
> Dear all,
> 
> We have a question regarding the computation of covariance matrices with  
> EEG and MEG in MNE:
> 
> The inverse is always computed on the average reference data (for EEG).  
> Therefore the covariance matrices should be computed on the average  
> reference too. Although the inverse solution, theoretically, does not depend  
> on the choice of reference electrode, one has to make sure that the  
> leadfield, covariance matrix, and data are referenced in the same way when  
> performing the computations in MNE. Apparently, MNE always uses average  
> reference for the leadfield and the data, but not necessarily for the  
> covariance matrices.  
> This means that we have to use the option --projon when we are computing  
> the covariance matrices with mne\_process\_raw.  
> If we use the --projoff option, then the covariance matrices are computed  
> with the acquisition reference, and therefore, the inverse solution will be  
> incorrect.
> 
> Are we right?
> 
> You are bringing up an important point. However, this is automatically  
> accounted for in MNE.
> 
> The average reference is equivalent to a projection operator. When the  
> inverse operator is put together, this projection is automatically applied  
> to the noise covariance matrix as well. Therefore, it is OK to leave the  
> projection off when the noise covariance matrix is computed.
> 
> Incidentally, I have found that sometimes the (for reasons I do not exactly  
> know) the EEG noise covariance is not as "good" when you look at its  
> eigenvalue spectra as the MEG one. Therefore, especially when computing  
> combined MEG/EEG estimates I usually regularize the noise covariance using  
> --megreg 0.1 and --eegreg 0.1 options to mne\_do\_inverse\_operator.
> 
> I hope this helps,  
> Matti
> 
> -------------
> 
> Matti Hamalainen, Ph.D.
> 
> Athinoula A. Martinos Center for Biomedical Imaging
> 
> Massachusetts General Hospital
> 
> Building 149, 13th Street, Mailcode 149-2301
> 
> Charlestown, MA 02129-2060
> 
> USA
> 
> e-mail msh at nmr.mgh.harvard.edu
> 
> Tel +1 617 726 0323
> 
> FAX +1 617 726 7422
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20090427/7d2ef7c2/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20090427/7d2ef7c2/attachment.html)
