[Mne_analysis] capping number of trials per condition in -gave.fif using mne_process_raw

Eric Larson larson.eric.d at gmail.com
Mon Jul 23 11:50:12 EDT 2012
Search archives:

Hey Matt,

Here's what we do when dealing with trial counts. First, we equalize
trial counts across conditions to avoid bias. We do this because we
noticed that when using the absolute value of MNE/dSPM estimates to
perform paired comparisons (condition A versus condition B) across
vertices and time points, using the absolute value produces a bias
toward more activation in the lower-trial-count condition. For
example, imagine if noise were normally distributed for the MNE or
dSPM score (with mean equal to the true activation level), then the
magnitude of those estimates will yield from a folded normal
distribution, where the mean (which we want to think of as just the
magnitude of the real activation) is now influenced by the standard
deviation of the original noise. This is a problem because that
effective standard deviation depends in part on the trial count used
to calculate the mean.

In any case, to equalize the trial counts, we subsample our data and
underpower our analysis by taking trials that are equally spaced
throughout the runs. This is done because in our data, the
lower-trial-count conditions typically are spread throughout the
recording session, as well. By undersampling evenly across the
recording session, we're trying to maximize how well we match the
noise characteristics under all conditions. This becomes a tad bit
more difficult to do correctly because MNE rejecting trials under
certain criteria also removes trials from analysis, but it can be
done.

But, either way it's done---with our spread undersampling or your
using the first N trials---you're eventually going to hit the problem
you're dealing with, where there are no trials to average over for
particular runs. The solution we use is to check to see if a run is
used, and if it's not, remove its parameters from the call to
mne_process_raw. Since you're coding MATLAB anyway, hopefully this
isn't too big a pain.

Cheers,
Eric


On Mon, Jul 23, 2012 at 7:49 AM, Matti Hamalainen
<msh at nmr.mgh.harvard.edu> wrote:
>
> On Jul 23, 2012, at 5:05 PM, Matthew Panichello wrote:
>
> Hello,
>
> I'm using mne_process_raw to create grandaveraged data for each individual
> subject. Each subject's data were collected over five runs and so are saved
> in 5 raw fiff files.
>
> The task included 5 different trial types presented in a mixed-event design.
> I'd like to set a cap on the number of trials per condition, such that even
> if a subject completed 90 trials of Condition #1 over the 5 runs, for
> example, only the first 75 will be saved in his grandaverage file.
>
> I tried to implement this by writing a matlab script that reads the event
> files for each run and removes events from each condition until the cap is
> met. But, for some subjects, this results in a completely empty event file
> for run 5 (the script begins with the last run), causing mne_process_raw to
> exit when I actually try to produce the average.
>
> Is anyone aware of a simpler way to control the number of trials used to
> compute the grandaverage using mne_process_raw?
>
> Also, while I was working on this, I noticed the following window output by
> process_raw:
> "filter: .5 .... 120 Hz  bins : 6 .... 1636 of 4097 hpw : 3 lpw : 34
> Highpass filter will work as specified
> filter: 0 .... 40 Hz  bins : 0 .... 545 of 4097 hpw : 3 lpw : 34
> Highpass filter will work as specified"
>
> I specify a 120 Hz lp filter and a .5 Hz hp filter in my input to
> process_raw, so I was surprised to see what seems to be an additional 40 Hz
> lp filter being applied. Can anyone comment on why this might be?
>
>
> Hi Matt,
>
> You are using the nightly build which has a separate filter setting for EOG.
> mne_process_raw --help reveals:
>
>         --eoghighpass val/Hz      EOG highpass corner (default =    0.0 Hz)
>         --eoglowpass  val/Hz      EOG lowpass  corner (default =   40.0 Hz)
>         --eoghighpassw val/Hz     EOG highpass transition width (default =
> 0.0 Hz)
>         --eoglowpassw val/Hz      EOG lowpass transition width (default =
> 5.0 Hz)
>
> In your particular example, the MEG/EEG data are filtered from 0.5 to 120 Hz
> according to your specification but the default lowpass (40 Hz) is used for
> EOG.
>
> - Matti
>
>
>
>
> ---------
>
> Matti Hamalainen, Ph.D.
> Athinoula A. Martinos Center for Biomedical Imaging
> Massachusetts General Hospital
>
> msh at nmr.mgh.harvard.edu
> mhamalainen at partners.org
>
>
>
>
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> 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.
>



More information about the Mne_analysis mailing list