Skip to contents

This function estimates the HRF using GAMs from the mgcv package. The HRF can be estimated with or without fixed effects.

Usage

estimate_hrf(
  form,
  fixed = NULL,
  block,
  dataset,
  bs = c("tp", "ts", "cr", "ps"),
  rsam = seq(0, 20, by = 1),
  basemod = NULL
)

Arguments

form

A formula specifying the event model for the conditions of interest

fixed

A formula specifying the fixed regressors that model constant effects (i.e., non-varying over trials); default is NULL

block

A formula specifying the block factor

dataset

An object representing the fMRI dataset

bs

Basis function for the smooth term in the GAM; one of "tp" (default), "ts", "cr", or "ps"

rsam

A sequence of time points at which the HRF is estimated (default: seq(0, 20, by = 1))

basemod

A baseline_model instance to regress out of data before HRF estimation (default: NULL)

Value

A matrix with the estimated HRF values for each voxel

Examples


# To be added