LIMO-EEG-Toolbox / limo_tools

Hierarchical Linear Modelling for MEEG data
https://limo-eeg-toolbox.github.io/limo_meeg/
Other
59 stars 27 forks source link

limo_preproc_stats_hw error #107

Closed arnodelorme closed 2 years ago

arnodelorme commented 2 years ago

Version in https://github.com/sccn/eeglab_tests/tree/master/unittesting_limo

Crash on the call to pop_limo

STUDY  = pop_limo(STUDY, ALLEEG, 'method',mode,'measure','daterp','timelim',[-50 650],'erase','on','splitreg','off','interaction','off');

The error message is below

Error using limo_WLS (line 43)
WLS cannot be computed, for at least 1 condition, all trials have the same values

Error in limo_glm (line 172)
    [Betas,W,rf] = limo_WLS(X,Y);

Error in limo_glm_handling (line 111)
            model = limo_glm(squeeze(Yr(channel,:,:))',LIMO);

Error in limo_eeg (line 476)
            limo_glm_handling(LIMO)

Error in psom_pipeline_debug (line 11)
    eval( [ commands.(fields1{iField1}).command ] );

Error in limo_batch (line 488)
        psom_pipeline_debug(pipeline(subject));

Error in std_limo (line 553)
    [LIMO_files, procstatus] = limo_batch('model specification',model,[],STUDY);

Error in pop_limo (line 168)
[STUDY,limofiles] = std_limo(STUDY, ALLEEG, options{:});

Error in limo_preproc_stats_hw (line 79)
STUDY  = pop_limo(STUDY, ALLEEG, 'method',mode,'measure','daterp','timelim',[-50 650],'erase','on','splitreg','off','interaction','off');

43      error('WLS cannot be computed, for at least 1 condition, all trials have the same values')
CPernet commented 2 years ago

doesn't look like an error to me - that part of the code has been there for a long time, so maybe the data you use for testing are different?

if isempty(Y(:,mad(Y,1) > 1e-6)) % time points for which medians of trials > 1e-6
    error('WLS cannot be computed, for at least 1 condition, all trials have the same values')
end

Y = 2D matrix of EEG data (dim trials x frames) tells you that all frames have values not deviating more than 1e-6, i.e. data = a constant value (but I use 1e-6 because of precision errors)

arnodelorme commented 2 years ago

I am testing the vanilla Hanson Wakeman data (ds002718) with the script provided. Can you try it?

CPernet commented 2 years ago

I have not re-preprocessed the data, but for me https://github.com/LIMO-EEG-Toolbox/limo_test_stats/blob/master/limo_test_integration.m worked

I have now added design with a constant only and it worked as well (with the added fix in std_limo) -- I really think the issue are the data in ...

CPernet commented 2 years ago

WLS doesn't fail, this issue moved on another topic due to bad data in