cvnlab / GLMsingle

A toolbox for accurate single-trial estimates in fMRI time-series data
BSD 3-Clause "New" or "Revised" License
101 stars 45 forks source link

Issue when running GLMsingle without cross-validation (no repeated trials) #138

Closed biancasanti closed 4 months ago

biancasanti commented 5 months ago

We are using GLMsingle to analyze data in which there are no repeated trials, and we wanted all four models with no cross-validation given that there are no repeats. The documentation specifies that you can run glmsingle with glmdenoise and fracridge without any repeated conditions as long as = -B and is a single scalar value so that no cross-validation is run for denoising and fracridge.

However, when we ran GLMsingle (the python version) with = 1 and = 1, a negative value and a single scalar value for , it only ran models A and B and didn't run models C and D. The main issue was that there is a block (lines 662-677 in glmsingle.py) that issues warnings if there are no repeats and then sets and to 0, with no exceptions if there's a negative value and a scalar value. We fixed this for ourselves by manually removing the lines that set and to 0, which allowed the model to run correctly for our purposes (outputting all 4 model types with no cross-validation).

While running glmsingle without repeats and without cross-validation is obviously not the main use case, it would be great if this could be fixed so that the script behaves as specified by the documentation when the correct values are given. Specifically, a fix that keeps the warning messages if there's no repeats but has an exception where and remain set to 1 if is negative and is a scalar value should fix the issue.

candemircan commented 4 months ago

was just having the same issue :) would be great if you can fix this. thanks a lot!

kendrickkay commented 4 months ago

Fixed with #140