JoramSoch / MACS

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

MA_inspect_GoF: More options #11

Closed SRSteinkamp closed 11 months ago

SRSteinkamp commented 1 year ago

Hi all,

thanks for putting the toolbox together :)

I am using MACS currently only for the GoF measures, and I am hacking something together to provide GoF only for the model regressors, after confound removal. Which I initially thought was what the GoF measures were used for.

If you are interested in adding this functionality, I could try to make it less hacky and submit a PR?

Best Simon

JoramSoch commented 1 year ago

Dear Simon,

thanks for your message! Before you submit a PR, I just wanted to clarify what the reasoning behind this is:

a. If the confound variables (I understand this to mean motion regressors, maybe respiratory signals, mean GM/WM/CSF signal etc.) are included in the same way in all models, then I would also advise to calculate GoF measures for the whole models, in order to correctly appreciate the complexity of the model and not to disguise estimated model parameters into preprocessing (e.g. adjusted R^2 uses the number of regressors).

b. If the confound variables are not included in all models in the same way, then the GoF measures from different models should not be compared anyway (although, of course, the way of handling confounds is the only difference between the models in question) in order not to reach spurious conclusions.

Or is the idea only to get higher R^2 values by partialling out some part of the variance before quantification of what the event-based regressors explain? But would this actually increase R^2?

Cheers Joram

SRSteinkamp commented 1 year ago

(Sorry, I have a hard time formulating my answer right now, so it might be slightly confusing).

I think my "issue" with the normal GoF statistic arose, when I calculated it on data where I used a set of cosine regressors instead of SPMs high-pass filter. This lead to slightly weird plots line plots (of course as no HPF was applied), and R^2 ~ 1 in border slices, so perfect prediction by noise components.

Thus, I thought, it might also be useful to know what the explained variance after preprocessing of a model is. So I guess, it would be more of a partial R^2 by regressors of interest, rather than the whole model (and I am pretty sure to lower R^2 scores...).

This could be to test between models with the same set of noise regressors or just a check if the model (meaning the task regressors) actually explains some part of the neural data - as prudence check and not to really solely on t or F statistics.

JoramSoch commented 1 year ago

Dear @SRSteinkamp,

I see your point. As far as I understand, you want to calculate R^2 after removing variance components that explain so much variance, that with not removing them beforehand, R^2 is close to 1. You can of course implement such a functionality, but I would vote for this being a non-default option selectable via an input argument in the interface function MA_inspect_GoF.m or other batch options in the GUI-based batch_MA_inspect_GoF.m (see Toolbox Manual, section 3).

(And I would encourage to check the pipeline, since even with no signals other than trends that can be explained by temporal drift regressors, I would still expect fMRI in a magnitude that R^2 values close to 1 are unlikely. Few cosine regressors [NB: SPM's high-pass filter also uses a discrete cosine transform (DCT) set, see spm_filter.m, e.g. applied in MA_inspect_GoF.m] are typically not able to explain so much residual variance that explained variance nearly equals total variance.)

Cheers, @JoramSoch