Which time points should I use to compute the covariance matrix?

Dear MNE users,

I'm running a single-trial analysis on epoch data. I'm not sure what "tmin"
and "tmax" should be set to in the covariance description file. The template
at share/mne/mne_browse_raw/templates/sample.cov only uses the baseline
period (200 ms before each trial). Other description files I've seen use the
whole epoch. Which way is better?

A related question -- the manual recommends specifying the option
"keepsamplemean", but it doesn't appear in the template. Are there cases in
which this option should not be set?

Thanks in advance.

Tal Linzen,
Neurolinguistics lab, New York University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20110329/416c8017/attachment.html

Hi Tal Linzen,

"tmin" and "tmax" should reflect whatever period of the data you want to
consider as noise. "bmin" and "bmax" are the period whose DC offset is
removed from the data. What period you want to consider noise depends on
what the data and analyses are. One situation I can think of where you
would use 'the whole epoch' is when you are using additional measurements
such as empty room MEG to get your noise covariance estimate.

If 'keepsamplemean' is not set, the average over trials of each point is
removed which could underestimate the covariance. Setting the
'keepsamplemean' reflects the assumption that the true sample by sample
mean in the tmin to tmax period is zero. So whenever that assumption is
not good, not setting 'keepsamplemean' will help avoid overestminating the
covariance. For instance, from the manual: "Subtraction of the means at
individual samples is useful if it can be expected that the evoked
response from previous stimulus extends to part of baseline period of the
next one."

Regards,
Hari