Combine HRF Basis with Coefficients
hrf_from_coefficients.Rd
Create a new HRF by linearly weighting the basis functions of an existing HRF. Useful when coefficients have been estimated for an FIR/bspline/SPMG3 basis and one wants a single functional HRF.
Usage
hrf_from_coefficients(hrf, h, ...)
# S3 method for class 'HRF'
hrf_from_coefficients(hrf, h, name = NULL, ...)
Examples
# Create a custom HRF from SPMG3 basis coefficients
coeffs <- c(1, 0.2, -0.1) # Main response + slight temporal shift - dispersion
custom_hrf <- hrf_from_coefficients(HRF_SPMG3, coeffs)
# Evaluate the custom HRF
t <- seq(0, 20, by = 0.1)
response <- evaluate(custom_hrf, t)
# Create from FIR basis
fir_coeffs <- c(0, 0.2, 0.5, 1, 0.8, 0.4, 0.1, 0, 0, 0, 0, 0)
custom_fir <- hrf_from_coefficients(HRF_FIR, fir_coeffs)