Skip to contents

Convert a shared time basis matrix B (T×r) into an fmrihrf::HRF object so it can be used directly in OASIS design construction. The HRF returns the r basis columns evaluated at arbitrary times by piecewise-linear interpolation on the provided time grid.

Usage

sbhm_hrf(B, tgrid, span)

Arguments

B

A numeric matrix (T×r) with orthonormal columns (shared basis).

tgrid

Numeric vector of length T giving the global times (seconds) corresponding to the rows of B.

span

Numeric HRF span passed to fmrihrf::HRF() metadata.

Value

An fmrihrf::HRF object with nbasis = ncol(B).

Examples

# \donttest{
  tgrid <- 0:30
  candidates <- cbind(exp(-tgrid / 5), tgrid * exp(-tgrid / 5))
  B <- qr.Q(qr(candidates))
  hrf_B <- sbhm_hrf(B, tgrid, span = 30)
  fmrihrf::nbasis(hrf_B)
#> [1] 2
# }