Building Regressors
Bradley R. Buchsbaum
2023-05-09
Source:vignettes/a_02_regressor.Rmd
a_02_regressor.Rmd
Building fMRI regressors from event onsets
Suppose we have a simple event-related fMRI design with 10 stimuli spaced every 12s. We want to model each event with the SPM canonical hemodynamic response function (HRF). The duration of each event is 0s, or “instantaneous”. We have 140s worth of contiguous scanning data, collected in a single scanning run with a repetititon time (TR) of 2s.
Building fMRI regressors from event onsets with varying duration
Sometimes different fMRI events have different durations and we want to model this variation.We can do this as follows:
The durs
vectors contains the durations, which increase
over the course of the block. We now supply this vector the the
regressor
function:
We can disable additive summation of the hemodynamic response
function by including summate=FALSE
in the call to
regressor
. This will cause the width of the HRF to
increase with duration but not the peak.
Building fMRI regressors from event onsets with varying amplitude
Sometimes we assume that each the amplitude of each event is modulated by an arbitrary continuous variable, for example “learning rate” or “intensity”. We can create a so-called parameteric regressor by scaling the hemodynamic response by an external variable as follows:
It is customary center and scale the parametric modulator: