Skip to contents

A hemodynamic response function based on the SPM canonical double gamma parameterization.

Usage

hrf_spmg1(t, P1 = 5, P2 = 15, A1 = 0.0833)

Arguments

t

A vector of time points.

P1

The first exponent parameter (default: 5).

P2

The second exponent parameter (default: 15).

A1

Amplitude scaling factor for the positive gamma function component; normally fixed at .0833

Value

A vector of HRF values at the given time points.

Details

This function models the hemodynamic response using the canonical double gamma parameterization in the SPM software. The HRF is defined by a linear combination of two gamma functions with different exponents (P1 and P2) and amplitudes (A1 and A2). It is commonly used in fMRI data analysis to estimate the BOLD (blood-oxygen-level-dependent) signal changes associated with neural activity.

See also

Examples

# Generate a time vector
time_points <- seq(0, 30, by=0.1)
# Compute the HRF values using the SPM canonical double gamma parameterization
hrf_values <- hrf_spmg1(time_points)
# Plot the HRF values
plot(time_points, hrf_values, type='l', main='SPM Canonical Double Gamma HRF')