Back to the main page.

Bug 2645 - ft_timelockanalysis does not deal properly with data containing NaNs

Status CLOSED FIXED
Reported 2014-07-10 12:42:00 +0200
Modified 2021-09-16 14:57:21 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Eelke Spaak
URL:
Tags:
Depends on:
Blocks: 3220
See also: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3238

Eelke Spaak - 2014-07-10 12:42:43 +0200

I believe it should handle the data in a nanmean-like fashion. Preferably it would also keep track of the dof used (i.e. a nan at a timepoint does not add a dof at that timepoint), but this is not necessary I guess.


Jan-Mathijs Schoffelen - 2016-02-24 09:20:29 +0100

This sounds like a reasonable expectation. Yet, since the bug has been open for quite a while now, it does not seem urgent. I think it would be as simple as temporarily converting the nans in the dat matrix to 0's (around line 280), before computing the running sum, and to appropriately update the dof variable in line 283. @Eelke, could you push this forward with a separate branch, test-script and pull request, please? Otherwise, I suggest to close the bug, since no one else will probably do it.


Eelke Spaak - 2016-02-24 09:38:23 +0100

(In reply to Jan-Mathijs Schoffelen from comment #1) Sure!


Robert Oostenveld - 2017-08-25 11:10:21 +0200

I ran into this with Stefan and Malina (now CC). It would be nice if this could be resolved.


Jan-Mathijs Schoffelen - 2017-08-25 12:38:10 +0200

Perhaps this can be solved, but it probably would also require (or be a good moment) to rethink the vartrllength options...


Jan-Mathijs Schoffelen - 2021-09-16 14:57:12 +0200

This currently seems to work just fine. Closing