 # confusion about the results of combine evoke

I would like to know which is the best way to calculate the difference waves in the oddball paradigm?

The original oddball difference wave seems to be just a direct subtraction of the EEG values of the deviant and standard stimuli, and the code implementation of mne seems to be different from this?

I have some confusion about the principle and results of combine evoke.

If I get the standard stimulus minus the abnormal stimulus to produce a differential stimulus result (oddball paradigm).
The function provided by mne seems to be the combine evoke function.

But shouldn’t the total number of evokes be the same?
For example, if I have 100 standard stimuli and 100 abnormal stimuli, then

odd = mne.combine.evoked([std,dev],weights=[-1,1])

After that, shouldn’t there be 100 different stimuli?

But it seems that both mne’s own sample code and the one I came up with halve the number of stimuli.

And I’m curious what the difference is between these two codes? Why does the generated evoke have a different nave?
(dev_all evoke number =130 std_all evoke number = 130)
odd_all = mne.combine_d([dev_all, std_all], weights=[1, -1])

odd_all = mne.combine_d([dev_all, -std_all], weights=‘equal’)

the `.nave` attribute of an `Evoked` object informs about the number of trials that were averaged to obtain the ERP. Since the difference wave is the difference between two averages (two ERPs), the `.nave` may no longer make much sense. But it depends on the weights that you use during combining - make sure that you read the Warning note from the documentation on `mne.combine_evoked`:
https://mne.tools/stable/generated/mne.combine_evoked.html

I think it’s also worth checking out what “nave” actually means and how we compute it. I don’t think this is properly documented outside of our source code, so here’s a link to the relevant bits:

Good point @richard. So, to extend my previous answer - as stated in the code comment the `.nave` parameter is used as an estimate of variance (`1 / nave`) during inverse operations (projecting data to source space). The variance accumulates when you perform difference operations (subtracting two noisy signals gives you even noiser difference) so the `.nave` changes to reflect that - and as a result is lower than your original `.nave`.

2 Likes

I have understood the essence of nave, which seems to be a manifestation of variance.

I would also like to ask if that means
odd_all = mne.combine_d([dev_all, std_all], weights=[1, -1]) can correctly derive the value of the difference stimulus - standard stimulus?
I can now understand the reason for the variation, but I would like to ask if the values are correctly calculated?

Yes, this will calculate the difference and not apply any special weights when doing so. For a contrast like “deviant vs standard”, this is typically exactly what you want.

1 Like

Thank you very, very much!