andersonwinkler / PALM

PALM: Permutation Analysis of Linear Models
70 stars 28 forks source link

Octave's statistics is not loaded for f-tests #29

Open jorgman1 opened 3 years ago

jorgman1 commented 3 years ago

I encountered a small problem when running PALM on Debian 10.9 (Octave 4.4.1). When it came to the f-contrasts, the "betainv" function from the statistics package was not loaded and it yielded the following error:

Building null distribution. 80% [Design 1/1, Contrast 9/10, Shuffling 1/5000, Modality 1/1] Saving file: palm_vox_fstat_c9 warning: implicit conversion from numeric to char

Error using palm_gtoz (/opt/PALM/palm_gtoz.m:92) 'betainv' undefined near line 92 column 19

Error in palm_core (/opt/PALM/palm_core.m:1626->palm_gtoz) Error in palm (/opt/PALM/palm.m:81->palm_core)

I solved it by always forcing the package load in palm_takeargs.m (line 1744). I guess there is an "opts.fstat" or similar, that can be added to the if-clause, but I could not find the correct name.

if palm_isoctave
    pkg load statistics
    if opts.spatial.do && any(plm.Yisvol)
        pkg load image
    end
    if opts.accel.lowrank || opts.zstat || opts.corrcon
        pkg load statistics
    end
end
andersonwinkler commented 3 years ago

Hi jorgman1,

Thanks for indicating this. It's a change that can be made for the next version, absolutely. Thanks!

All the best,

Anderson