<p>When using minimum norm methods for source estimation (in the case of EEG), which is to say going from the signal at the recording sites on the scalp to the signals in source space, i.e. equivalent dipoles for instance in an idealized cortical surface, a noise covariance matrix is often needed.</p>
<p>First of all, how is it computed? From what I have read, for instance in the MNE-Python package (<a href="https://mne.tools/stable/generated/mne.compute_raw_covariance.html" rel="nofollow noreferrer">source</a>), the data is epoched into equal length segments, then the &quot;covariance is computed&quot;. What is the precise mathematical formula applied to those epochs?</p>
<p>Second of all, this covariance matrix is said to be a measure of the reliability of the sensors. Why is that?</p>

CC BY-SA 4.0
2023-11-29T16:32:51.323Z
Can you clarify a bit which parts you do and do not understand? E.g., are you familiar with the concept of a "covariance matrix" overall? It also might be useful to provide a particular reference, as sometimes a noise covariance matrix comes from a measurement of true noise, like in an empty room, and in other cases "noise" means "background brain activity" which is some peoples' signal but other peoples' noise.
Bryan Krause
CC BY-SA 4.0
2023-11-29T16:38:58.760Z
@BryanKrause I am familiar with the concept of the covariance matrix of two random vectors, so I have no issues conceptualizing it as each element in it being the covariance between two channels. Is this what is happening? If it is, how is the choice of a duration and overlap for the epoching justified?
David Cian
CC BY-SA 4.0
2023-11-29T16:40:28.673Z
@BryanKrause As for the raw data, let's assume it's background brain activity, since I mentioned EEG, but I don't think the part about the interpretation of it as a measure of reliability would have a different explanation if talking about MEG and empty room measurements, would it?
David Cian
CC BY-SA 4.0
2023-11-29T16:47:26.417Z
No epoching is really necessary if you're just using the raw voltage signal; possibly this is done because they're using a frequency representation? Calculating a variance requires multiple observations meaning you have to split the signal somehow, just an FFT will give you only one number per frequency and you can't calculate a variance on that. Choice of epoch duration for time-frequency analyses, there are some obvious bounds (Nyquist) but otherwise there's a time/bandwidth tradeoff and assumptions about temporal correlations to deal with. There's no mathematical "best" answer.
Bryan Krause
CC BY-SA 4.0
2023-11-29T16:49:27.670Z
I think it's quite important for the interpretation of reliability what the actual noise source measured is; if it's empty room you're talking about the signal-to-noise of the sensor array itself. If it's background brain activity you're talking about your ability to detect a (potentially weak) evoked signal, which could partly depend on sensor properties but is also going to depend on brain state (e.g., way easier to detect a signal in a deeply anesthetized brain than a wake one).
Bryan Krause
CC BY-SA 4.0
2023-11-29T16:51:17.133Z
One of the challenges in reading/interpreting EEG papers is that because there are software toolboxes to help people out, a lot of people do EEG analysis by recording data and pushing a button. When the authors say "covariance is computed" they might mean "I pushed the *compute covariance* button in MyFavoriteEEGToolbox"; you can dig through older papers to get an idea or sometimes it's easier to just find the software package they used and read the code.
Bryan Krause
CC BY-SA 4.0
2023-11-29T17:32:59.057Z
@BryanKrause Thanks, I've decided to do just that, read the code and older papers. There is still one part of the question which I haven't found an answer to, be it in older papers or package documentation: how is the covariance matrix interpreted as sensor reliability? Higher covariance = better reliability? The opposite? Why?
David Cian
CC BY-SA 4.0
2023-11-29T18:26:53.430Z
I'm curious who is connecting it to *reliability* and whether they're using that word in a casual way or perhaps borrowing it from a separate EE/signal processing context where the measure may be the same but the application is a bit different (e.g., detection vs source reconstruction).
Bryan Krause
CC BY-SA 4.0
2023-11-30T01:02:14.467Z
@BryanKrause So it's almost always mentioned in the context of source estimation, not detection, and [here](https://www.sciencedirect.com/science/article/pii/S1053811903007845?via%3Dihub) is an example.
David Cian
CC BY-SA 4.0
2023-11-30T20:18:02.300Z
I'm not seeing reference to sensor "reliability" in that source.
Bryan Krause
CC BY-SA 4.0
2023-11-30T23:31:09.083Z
@BryanKrause Sorry, should've specified where. Right below equation 13, there is the following mention: "Cd is a positive definite weighting matrix, representing the “reliability” of the sensors (e.g., by their standard deviations or covariances)".
David Cian
CC BY-SA 4.0
2023-12-01T15:21:14.803Z
Thank you for your patience, I had opened the link, saw that it went past the abstract and, assuming the full text had loaded, did a search on the page for "reliability" and found nothing; however, the full text had not loaded so I missed it. My intuition is that they are using this word very imprecisely; the important takeaway is that a reasonable decision would be to minimize eq 13 (which is a scalar). In this context, it seems they're considering noise to be an additive voltage which would mean channels with more variance have more information on top of that additive voltage noise.
Bryan Krause
CC BY-SA 4.0
2023-12-01T15:22:36.330Z
I'm not sure that I buy this assumption, though my experience is not with (extracranial) EEG.
Bryan Krause
CC BY-SA 4.0
2023-12-01T15:51:06.857Z
It also doesn't seem like Cd is actually a "noise covariance matrix" at all.
Bryan Krause
<neuroscience><eeg>
How is the noise covariance matrix computed and why is it a good measure of sensor reliability?
David Cian
# How is the noise covariance matrix computed and why is it a good measure of sensor reliability?

(Asked by: username_0 on 2023-11-29)

When using minimum norm methods for source estimation (in the case of EEG), which is to say going from the signal at the recording sites on the scalp to the signals in source space, i.e. equivalent dipoles for instance in an idealized cortical surface, a noise covariance matrix is often needed.

First of all, how is it computed? From what I have read, for instance in the MNE-Python package ([source](https://mne.tools/stable/generated/mne.compute_raw_covariance.html)), the data is epoched into equal length segments, then the "covariance is computed". What is the precise mathematical formula applied to those epochs?

Second of all, this covariance matrix is said to be a measure of the reliability of the sensors. Why is that?

**Tags:** neuroscience, eeg

> **Comments:**
> **username_1**: Can you clarify a bit which parts you do and do not understand? E.g., are you familiar with the concept of a "covariance matrix" overall? It also might be useful to provide a particular reference, as sometimes a noise covariance matrix comes from a measurement of true noise, like in an empty room, and in other cases "noise" means "background brain activity" which is some peoples' signal but other peoples' noise.  
> **username_0**: @BryanKrause I am familiar with the concept of the covariance matrix of two random vectors, so I have no issues conceptualizing it as each element in it being the covariance between two channels. Is this what is happening? If it is, how is the choice of a duration and overlap for the epoching justified?  
> **username_0**: @BryanKrause As for the raw data, let's assume it's background brain activity, since I mentioned EEG, but I don't think the part about the interpretation of it as a measure of reliability would have a different explanation if talking about MEG and empty room measurements, would it?  
> **username_1**: No epoching is really necessary if you're just using the raw voltage signal; possibly this is done because they're using a frequency representation? Calculating a variance requires multiple observations meaning you have to split the signal somehow, just an FFT will give you only one number per frequency and you can't calculate a variance on that. Choice of epoch duration for time-frequency analyses, there are some obvious bounds (Nyquist) but otherwise there's a time/bandwidth tradeoff and assumptions about temporal correlations to deal with. There's no mathematical "best" answer.  
> **username_1**: I think it's quite important for the interpretation of reliability what the actual noise source measured is; if it's empty room you're talking about the signal-to-noise of the sensor array itself. If it's background brain activity you're talking about your ability to detect a (potentially weak) evoked signal, which could partly depend on sensor properties but is also going to depend on brain state (e.g., way easier to detect a signal in a deeply anesthetized brain than a wake one).  
> **username_1**: One of the challenges in reading/interpreting EEG papers is that because there are software toolboxes to help people out, a lot of people do EEG analysis by recording data and pushing a button. When the authors say "covariance is computed" they might mean "I pushed the *compute covariance* button in MyFavoriteEEGToolbox"; you can dig through older papers to get an idea or sometimes it's easier to just find the software package they used and read the code.  
> **username_0**: @BryanKrause Thanks, I've decided to do just that, read the code and older papers. There is still one part of the question which I haven't found an answer to, be it in older papers or package documentation: how is the covariance matrix interpreted as sensor reliability? Higher covariance = better reliability? The opposite? Why?  
> **username_1**: I'm curious who is connecting it to *reliability* and whether they're using that word in a casual way or perhaps borrowing it from a separate EE/signal processing context where the measure may be the same but the application is a bit different (e.g., detection vs source reconstruction).  
> **username_0**: @BryanKrause So it's almost always mentioned in the context of source estimation, not detection, and [here](https://www.sciencedirect.com/science/article/pii/S1053811903007845?via%3Dihub) is an example.  
> **username_1**: I'm not seeing reference to sensor "reliability" in that source.  
> **username_0**: @BryanKrause Sorry, should've specified where. Right below equation 13, there is the following mention: "Cd is a positive definite weighting matrix, representing the “reliability” of the sensors (e.g., by their standard deviations or covariances)".  
> **username_1**: Thank you for your patience, I had opened the link, saw that it went past the abstract and, assuming the full text had loaded, did a search on the page for "reliability" and found nothing; however, the full text had not loaded so I missed it. My intuition is that they are using this word very imprecisely; the important takeaway is that a reasonable decision would be to minimize eq 13 (which is a scalar). In this context, it seems they're considering noise to be an additive voltage which would mean channels with more variance have more information on top of that additive voltage noise.  
> **username_1**: I'm not sure that I buy this assumption, though my experience is not with (extracranial) EEG.  
> **username_1**: It also doesn't seem like Cd is actually a "noise covariance matrix" at all.  

---

## 0 answers

