Skip to contents

The `hrf_mexhat` function computes the Mexican hat wavelet-based HRF (hemodynamic response function) at given time points `t`.

Usage

hrf_mexhat(t, mean = 6, sd = 2)

Arguments

t

A vector of time points.

mean

A numeric value representing the mean of the Mexican hat wavelet. Default value is 6.

sd

A numeric value representing the standard deviation of the Mexican hat wavelet. Default value is 2.

Value

A numeric vector representing the Mexican hat wavelet-based HRF at the given time points `t`.

Details

The response is the Ricker (Mexican hat) wavelet centred at mean with width sd, set to zero before onset (t < 0): $$h(t) = \frac{2}{\sqrt{3\,sd}\,\pi^{1/4}} \left(1 - \left(\frac{t - mean}{sd}\right)^2\right) \exp\left(-\frac{(t - mean)^2}{2\,sd^2}\right).$$ The normalising constant gives the un-truncated wavelet unit L2 norm.

Examples

# Compute the Mexican hat HRF representation for time points from 0 to 20 with 0.5 increments
hrf_mexhat_vals <- hrf_mexhat(seq(0, 20, by = .5), mean = 6, sd = 2)