Noise covariance matrix with different conditions per subject EEG data

Hi, I’m trying to recostruct sources for EEG data collected with geodesic system 128 channels. My doubt is about how to compute noise covariance matrix. I have 20 subjects in my protocol, and I know I should compute a noise covariance based on the baseline for each subject but I’m not sure how to do it correctly with my experimental design. For each subject I have 6 conditions that represent 6 different stimuli used in the experimental paradigm, so inside each subject I have 6 folders with the single trial of each of the 6 stimuli. So my question is, should I compute a noise covariance matrix for each of the 6 conditions, obtaining 6 noise covariance matrices for each subject, or may I average all the trials separately for subject and then computing the noise matrix based on the subject average, obtaining a noise matrix per subject?
Thanks for your help

It’s probably OK to compute the noise covariance from all the conditions at once, if you expect the subject to be in a similar state before all the stimuli. The more time sample, the better: use all the data you can for the estimation of the noise covariance.

If the subject is engaged in a task at the time of the presentation of the stimulus, and if this task is different for the different stimuli, it is different, you’d have to estimate the noise covariance separately for each condition.

Thanks Francois for your replay. I’m actually doing the stats at the source level and a possible problem emerged with the solution you suggested me. If I use two noise covariance matrices, one for each task, and then I compare the two tasks statistically and I obtain significant results, can I assume that the results are reliable or it is possible that considering that the two kernels are different in the two conditions due to the different noise covariance matrix, the results may be related just to the noise covariance?
Thanks

This question belongs to the definition of your hypothesis and your experimental design.
Indeed, if you have multiple parameters that vary between two conditions, you can’t study the effect of only one at a time.

Hi Francois, thanks again for your response. I followed two different roads, the first one was reconstructing the source based on two different condition noise covariance matrices, one per each condition of my task. The noise covariance was calculated for each subjects from the average baseline of each condition as you suggested me. Then I reconstructed the source based on the one noise covariance. In this case the noise covariance was taken for each subject from the baseline of the average of all the conditions.
The results are very different. We obtain results more in line with our hypotheses when I used two different noise covariance. In this moment the hypotheses are quite basic, we expect to find an increase in source activity when we compare memory activity with 5 items compared to 2 items, considering that we found a stable effects in this direction at the sensor level.
My experimental design is not very complex, participants complete a visual memory task. But we have 2 conditions, in one condition the participants know how many items they will memorize, and in the other condition they don’t know how may items the will memorize. They do both tasks in the same session, and it is a block wise design, so that they know which tasks they are doing. We will compare within conditions to see how the brain activity increase based on the number of items to remember, and we will compare between conditions to see how the condition impacted on the memory performance and on the brain activity.
Considering this informations, which path do you suggest me to follow, the one with one noise covariance per condition, or the one with just a single covariance matrix? Because considering the effect on the source reconstruction this could have a big impact on the stats and their correct interpretation.
Thanks for your precious suggestions

The more time samples used to estimate the noise covariance, the more stable the estimate. However, you should only use segments of recordings that do not contain any of the brain activity of interest. Whatever is used to compute your noise covariance matrix will tend to disappear in your source maps. If any of the brain areas you are interested in are active during the “baseline” you use for estimating the noise covariance, they may not appear in your source results.
If you cannot get a decent “baseline” during the experiment, use one of the options described in the tutorials (resting before/after the experiment or no noise modeling at all).

I’m sorry, I don’t know enough about memory processing to give you better advices on your experiment.
Maybe @Sylvain has better suggestions?

Maybe what you observe (the influence of condition-specific baseline definition) points towards a hidden effect of condition framing in your experimental design. This would mean that in both conditions where the baseline is expected to be the same, well, it is not, as if participants could anticipate, even unconsciously, that a trial from this or that condition is about to occur and would therefore bias their ongoing brain activity towards processing this or that condition. Alternatively, maybe this is only a matter of empirical estimation of baseline covariance being not entirely stable with the number of samples and the variability observed in your data.
When in doubt, I would suggest trying a no-noise covariance model with EEG.
Hope this helps!