ept_TFCE-matlab icon indicating copy to clipboard operation
ept_TFCE-matlab copied to clipboard

tfce on uni-dimensional data

Open normanF opened this issue 7 years ago • 4 comments

Dear Armand,

is it possible to use your tb (or a function of it) to get tfce values for a two-condition comparison only along the time (or frequency) dimension?

Best, Norman

normanF avatar May 02 '18 16:05 normanF

Yes, this is fairly easy; although not-at-all intuitive...

Running the ept_TFCE scripts from the command line...

You would repmat your 1 temporal dimension into 2 dimensions (copy of the 1st)... then in your temporal-only case, set the flag_ft = true; so it doesn't look for a channel locations file.

You're output will also have 2 dimensions but you'll notice that the p-values etc are identical. While you might think that doing this would double the cluster-sizes found at all thresholds and this is somehow "not-okay"... it also doubles them for all permutations run and so just adjusts the scale of the TFCE values (and the empirical distribution)... but not at all the p-values.

Good luck!

Mensen avatar May 04 '18 09:05 Mensen

Nice hack, works perfectly. I guess ept_TFCE will then create another dimension and removes it again after TFCE transformation, right? At this place in the code, an additional parameter (deltaT) is handed over to the tfce transformer function. I get that this is the maximal difference between the conditions, which is divided by 50. I always wondered what this '50' is? cheers

normanF avatar May 06 '18 07:05 normanF

The threshold-free part is indicative of the calculation of a "supporting area" for each data point (e.g. individual channel-sample). In theory this can be calculated directly like an area under the curve (not quite the same as supporting area but close).

However, in practice this is actually calculated through approximation by having multiple progressive thresholds set from 0 to the maximum statistical point in small increments. So the smaller these increments, the more accurate to the true approximation of the supporting area... but the longer the calculation would take. "50" distinct increments is what the number means... this seams a little arbitrary but in empirical calculations from different signal types, this level of approximation was found to essentially never change a p-value before the 10^-6 decimal point... and given the random selection of permutations changes the p-values ahead of this point (again though depending on the number of permutations selected), then this "50" is a very safe selection that still allows the computation to be fast.

Mensen avatar May 06 '18 07:05 Mensen

Awesome, thanks for this explanation. Makes totally sense!

normanF avatar May 06 '18 11:05 normanF