evaluate: Evaluate a regressor object over a time grid

View source: R/all_generic.R

evaluateR Documentation

Evaluate a regressor object over a time grid

Description

Generic function to evaluate a regressor object over a specified time grid. Different types of regressors may have different evaluation methods.

evalute a regressor function over a sampling grid

Usage

evaluate(x, grid, ...)

## S3 method for class 'regressor'
evaluate(x, grid, precision = 0.33, use_conv = FALSE, ...)

Arguments

x

The regressor object to evaluate

grid

the sampling grid. A vector of real values in seconds.

...

Additional arguments passed to specific methods

precision

the sampling precision for the hrf. This parameter is passed to evaluate.HRF

use_conv

use fast convolution approach

Value

A numeric vector or matrix containing the evaluated regressor values

See Also

single_trial_regressor(), regressor()

Examples

frame <- sampling_frame(blocklens=100, TR=2)
reg <- regressor(onsets=c(10,12, 14, 16, 18,20,35, 47,52, 68, 79,86), amp=runif(12), 
duration=runif(12)*3, hrf=HRF_SPMG1)
e1 = evaluate(reg, samples(frame))
e2 = evaluate(reg, samples(frame), use_conv=TRUE)

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