lyman.glm.condition_to_regressors

lyman.glm.condition_to_regressors(name, condition, hrf_model, n_tp, tr, res, shift)[source]

Generate design matrix columns from information about event occurrence.

Parameters
namestring

Condition name.

conditiondataframe

Event information corresponding to a single condition. Must have onset (in seconds), duration (in seconds), and value (in arbitrary units) columns; and should correspond to event occurrences.

hrf_modelHRFModel object

Object that implements .transform() to return a basis set for the predicted response.

n_tpint

Number of time points in the final output.

trfloat

Time resolution of the output regressor, in seconds.

resfloat

Sampling resolution at which to construct the regressor and perform convolution with the HRF model.

shiftfloat

Proportion of the TR to shift the predicted response when downsampling to the output resolution.

Returns
regressorscolumn(s)

One or more output regressors that will form columns in the design matrix corresponding to this event type.