bachlab / PsPM

A matlab suite for Psycho-Physiological Modelling
GNU General Public License v3.0
43 stars 10 forks source link

Using different basis functions for GLM #148

Closed laurenyatlas closed 4 years ago

laurenyatlas commented 4 years ago

Feature Description

Hello - thanks again for the great training this past spring. My lab has been comparing SCR analysis platforms across our different heat pain studies. Our stimuli are 8-10s heat pain, and so we did not feel the SCR basis functions included by default in PsPM were likely to capture the sustained responses we see. We used FIR models in the first level GLM and confirmed we generally have multiphasic responses with a more complex shape. It would be nice to be able to now use this shape in the model and examine contrasts, i.e. to replace the SCR bfs with a different shape. Is this something that is possible in the existing software?

irojkov-ph commented 4 years ago

Hi @laurenyatlas , It depends on how you are performing your analysis. If you are using GUI of PsPM, then unfortunately it is not possible yet. On the other hand if you are using the "script" mode (i.e. you write a matlab script in which you call upon PsPM functions) then yes it is possible. In the GLM help text, you can read this:

% model.bf:         basis function/basis set; modality specific default
%                   with subfields .fhandle (function handle or string) and
%                   .args (arguments, first argument sampling interval will
%                   be added by pspm_glm). The optional subfield .shiftbf = n
%                   indicates that the onset of the basis function precedes
%                   event onsets by n seconds (default: 0: used for
%                   interpolated data channels)

As an example you can have a look at pspm_bf_FIR.m function (located in the ./src/ folder of you PsPM installation folder). Hope it was clear enough. Feel free to send us your custom basis function if you face some issues in the implementation :wink: