<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p>Hi list,<div class=""><br class=""></div><div class="">I recently came across that mne python uses 3 different formulas for calculating global field power (GFP). I’m wondering why.</div><div class="">They are:</div><div class=""><br class=""></div><div class="">-&nbsp;The spatial standard deviation</div><div class="">line 1492 of /mne/viz/utils.py</div><div class="">gfp = evoked.data.std(axis=0)</div><div class="">This is the original version as e.g. in Lehmann &amp; Skrandies (1980)&nbsp;<a href="http://dx.doi.org/10.1016/0013-4694(80)90419-8" class="">dx.doi.org/10.1016/0013-4694(80)90419-8</a></div><div class="">Note that the fieldtrip folks write about global field power “The naming implies a&nbsp;squared measure but this is not the case.” (see help text of the FT_GLOBALMEANFIELD function of the fieldtrip toolbox).</div><div class=""><br class=""></div><div class="">- Root mean square</div><div class="">line 2988 of /mne/viz/utils.py</div><div class="">combine_dict['gfp'] = lambda data: np.sqrt((data ** 2).mean(axis=1))</div><div class="">There is no subtraction of the mean across channels as would be the case for standard deviation.</div><div class=""><br class=""></div><div class="">- Again, root mean square</div><div class="">line 466 of /mne/viz/evoked.py</div><div class="">this_gfp = np.sqrt((D * D).mean(axis=0))<br class=""><br class="">- Sum of squares</div><div class="">line 131 of /examples/time_frequency/plot_time_frequency_global_field_power.py</div><div class="">gfp = np.sum(average.data ** 2, axis=0)<br class="">Here, we’re dealing with power values of a time-frequency decomposition, so that’s perhaps the reason for the missing mean and sqrt?</div><div class=""><br class=""></div><div class="">The mne python glossary at /doc/glossary.rst describes GFP as “the standard deviation of the sensor values at each time point”, consistent with Lehmann &amp; Skrandies. That seems to be correct only for the first formula mentioned here.</div><div class=""><br class=""></div><div class="">Any suggestions for the reasons of when to use which version and educated guesses of whether these differences matter in practice are highly welcome.</div><div class=""><br class=""></div><div class="">Thank you very much,</div><div class="">Christoph</div></body></html>