All-zero regressor warning #196
-
|
Hi. While I am running GLM single, I'm encountering a warning. For one subject only, I repeatedly get the following warning during FITTING TYPE-B MODEL (FITHRF) and CROSS-VALIDATING DIFFERENT NUMBERS OF REGRESSORS. "Warning: One or more regressors are all zeros; we will estimate a 0 weight for those regressors." I checked the design matrix carefully. Across the entire experiment (all runs concatenated), every column has at least one event, so there should not be any all-zero regressors. Run-wise, many regressors are zero (because in a lexical decision task experiment each word/pseudoword appears only once), but this is true for all subjects. Yet only this one subject triggers the warning. If you want, I can share my DESIGNINFO.npy with you via email. Do you have any idea about this warning? The below is a part of output. Thanks in advance! *** Saving design-related results to /path/to/DESIGNINFO.npy. *** *** FITTING TYPE-A MODEL (ONOFF) *** fitting model... preparing output... computing model fits... computing R^2... computing SNR... *** Saving results to /path/to/TYPEA_ONOFF.npy. *** *** Setting brain R2 threshold to 0.10324589326880167 *** *** FITTING TYPE-B MODEL (FITHRF) *** Warning: One or more regressors are all zeros; we will estimate a 0 weight for those regressors. *** Saving results to /path/to/TYPEB_FITHRF.npy. *** *** DETERMINING GLMDENOISE REGRESSORS *** *** CROSS-VALIDATING DIFFERENT NUMBERS OF REGRESSORS *** Warning: One or more regressors are all zeros; we will estimate a 0 weight for those regressors. *** FITTING TYPE-C MODEL (GLMDENOISE) *** *** Saving results to /path/to/TYPEC_FITHRF_GLMDENOISE.npy. *** *** FITTING TYPE-D MODEL (GLMDENOISE_RR) *** *** Saving results to /path/to/TYPED_FITHRF_GLMDENOISE_RR.npy. *** *** All model types done *** *** nothing selected to return *** |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
It is puzzling. I would need more information to diagnose, like the design matrix. |
Beta Was this translation helpful? Give feedback.
-
|
I'm having trouble reading the .npy file into MATLAB (using readNPY). Can you save as a .csv or different format?
… On Nov 14, 2025, at 9:13 PM, AndyJHKim ***@***.***> wrote:
I uploaded the design matrix files to my GitHub repository:
https://github.com/AndyJHKim/LDT
For reference:
sub-001 (and all other subjects) run without any warnings.
sub-002 triggers the “all zero regressor” warning.
The design matrices are created by the same code for every subject.
If you have a moment to take a look at the design matrix file for sub-002, I would greatly appreciate it.
Thanks a million for your help!
—
Reply to this email directly, view it on GitHub <#196 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAU2DEX2X5VIDTCPFUC7Z3L342K6HAVCNFSM6AAAAACMB4K5UGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIOJXGQ4DENA>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.


I did a spot check. The first run of the subject with an error has an event onset 14 rows before the end of the design matrix. For a TR of 0.25s , this means the onset is 3.5 s before the end.... This may be related to the warning you are getting. Basically, the HRF (if it's a delayed/late one) might still be all 0 for that very last trial. In which case the regressor is all zero. The code should be warning about occurrences like this (see attached). Also, see the attached HRF library figure (where the x-axis is in seconds).