evaluate.single_trial_regressor: Evaluate a single trial regressor

View source: R/regressor.R

evaluate.single_trial_regressorR Documentation

Evaluate a single trial regressor

Description

Method to evaluate a single trial regressor over a specified time grid. This computes the predicted BOLD response for the trial at each time point by convolving the trial event with its hemodynamic response function.

Usage

## S3 method for class 'single_trial_regressor'
evaluate(x, grid, precision = 0.3, ...)

Arguments

x

A single_trial_regressor object

grid

Numeric vector specifying the time points at which to evaluate the regressor

precision

Optional numeric value specifying the precision of the evaluation (default: 0.3)

...

Additional arguments passed to the HRF evaluation function

Value

A numeric vector containing the predicted BOLD response at each time point in the grid

See Also

single_trial_regressor for creating single trial regressors, evaluate.HRF for HRF evaluation details

Examples

# Create and evaluate a single trial regressor
reg <- single_trial_regressor(c(10), HRF_SPMG1)
grid <- seq(0, 30, by = 0.5)
response <- evaluate(reg, grid)

# Plot the response
plot(grid, response, type = "l", 
     xlab = "Time (s)", ylab = "BOLD Response")


bbuchsbaum/fmrireg documentation built on March 1, 2025, 11:20 a.m.