JoramSoch / MACS

MACS – a new SPM toolbox for model assessment, comparison and selection
GNU General Public License v3.0
23 stars 6 forks source link

goodness of fit does not run on second level GLM #17

Open Remi-Gau opened 3 months ago

Remi-Gau commented 3 months ago

The issue was raised here: https://github.com/cpp-lln-lab/bidspm/issues/1237

See for example:

SPM12: spm_spm (v7738)                             11:21:30 - 03/05/2024
========================================================================
Chunk   1/1                             :                        ...done
Spatial non-sphericity (over scans)     :                        ...done
Saving SPM.mat                          :                        ...done
Completed                               :          11:21:33 - 03/05/2024
Done
03-May-2024 11:21:33 - Done    'Model estimation'
03-May-2024 11:21:33 - Running 'MA: inspect goodness of fit'
03-May-2024 11:21:35 - Failed  'MA: inspect goodness of fit'
Index exceeds array bounds.
In file "/home/marcobarilari/data/tools/spm12/toolbox/MACS/MA_inspect_GoF.m" (???), function "MA_inspect_GoF" at line 283.
In file "/home/marcobarilari/data/tools/spm12/toolbox/MACS/MA_inspect_GoF.m" (???), function "MA_inspect_GoF" at line 155.
In file "/home/marcobarilari/data/tools/spm12/toolbox/MACS/batch_MA_inspect_GoF.m" (???), function "run_module" at line 66.

This would correspond to an error thrown here:

https://github.com/JoramSoch/MACS/blob/bce5dda1acbd93468c468bdc2833f35a0bec8105/MA_inspect_GoF.m#L276

As far as I cant tell this is GoF is by designed made to only work on subject level analysis, am I correct?

JoramSoch commented 3 months ago

Dear @Remi-Gau,

this is not a bug or an issue, but simply a missing feature.

As far as I cant tell this is GoF is by designed made to only work on subject level analysis, am I correct?

Yes, this is correct. Unfortunately, MA_inspect_GoF only works for first-level GLMs. However, I have already extended the cvLME-based model assessment to second-level GLMs (see MA_cvLME_other.m, also see this OHBM 2019 poster), so it would definitely be possible to implement this for MA_inspect_GoF.m (some things would even simplify!).

I'll leave this issue open as a reminder for me to work on this, but can't promise fast results, as examinations and holidays are ahead...

Cheers Joram

Remi-Gau commented 3 months ago

No worries and no rush. Thanks for the quick confirmation.