I’m trying to fit the First Level Model with nilearn, but I get the following warning: UserWarning: Matrix is singular at working precision, regularizing…After that python crashes and restarts the kernel.
I use 24 motion parameters+csf+white_matter from fmriprep confounds file. Do you know what might be the issue? Also, my events file is pretty big: 478 entries.
so i don’t create the design matrix explicitly, i use glm = glm.fit(fmri_img, events=events, confounds=confounds_clean)
but it should have more time points than regressors (I have only 33 in confounds_clean)
Could you call ‘make_design_matrix’ with the corresponding arguments ? This should create the design matrix you need. If it has too many columns, indeed the fit may simply go wrong.
Thanks a lot! I removed derivatives and power from the confounds dataframe and the warning disappeared. However, fitting GLM was still crashing. So I tried to run it on another computer and it worked.