mickcrosse / mTRF-Toolbox

A MATLAB package for modelling multivariate stimulus-response data
https://cnspworkshop.net
BSD 3-Clause "New" or "Revised" License
78 stars 29 forks source link

mTRFcrossval doesn't work on type='single' and 'fast'=0 #14

Open mosh-shu opened 1 year ago

mosh-shu commented 1 year ago

mTRFcrossval doesn't work when typeis 'single' and the 'fast' parameter is 0

xlag produced by lagGen at line 227 and Cxx produced from olscovmat at line 190 does not have the same shape, thus causing an error at line 229. The xlag at line 227 seems to be a 2-dimensional matrix with the size of (timepoints) (nChannelsnLags), and Cxx at line 229 seems to be a 3-dimensional matrix of nChannelsnChannelsnLags. So xlag'xlag at line 230 should give a 2-dimensional matrix with the size of (nChannelsnLags) (nChannelsnLags); I feel like this matrix should be reshaped to nChannelsnCHannelsnLags?

natezuk commented 1 year ago

Thanks for letting us know about this issue. I was able to replicate it by running single_lag_analysis.m but with the 'fast' parameter set to 0 in mTRFcrossval (line 56). @mickcrosse Can you look into this? I think the issue comes from the way olscovmat and lagGen are used, but I'm not sure of the best way to fix it.