GWeindel / hmp

Repository for the hmp python package
BSD 3-Clause "New" or "Revised" License
32 stars 8 forks source link

Durations and mean_d are based on max durations per subject instead of mean #56

Closed jelmerborst closed 1 year ago

jelmerborst commented 1 year ago

At least when fitting multiple subjects, mean_d and durations of the hmp model are based on the max duration (ie number of samples in the matrix) of each subject. They should be based on the mean of each subject.

This might be caused by that data.unstack() on line 60 of models.py gives the same number of epochs as there are subjects.

GWeindel commented 1 year ago

I do not see the problem you're pointing at as the code seems to do what is expected. Can you specify more what the actual vs. the expected behavior of those variables is?

jelmerborst commented 1 year ago

Nm, turned out there's an issue with using mne.filter.resample on matrices containing NaNs. After solving that, this bug turned out to be non-existent.