estimate_r1_glms: Estimate betas using Rank-1 GLM with separate designs...

View source: R/rank1_estimation.R

estimate_r1_glmsR Documentation

Estimate betas using Rank-1 GLM with separate designs (Mumford-style approach)

Description

This function estimates single-trial (or single-condition) betas in a rank-1 framework by splitting the design matrix xdat$X into a list of separate sub-designs (X_list), one for each condition (or event). It then calls r1_glms_betas() to jointly estimate the HRF shape and the per-condition amplitudes.

Usage

estimate_r1_glms(dset, xdat, hrf_basis, hrf_ref, maxit = 100)

Arguments

dset

An fmri_dataset object containing voxel data and mask

xdat

A list typically returned by get_X(), containing:

  • X: The stacked design matrix of dimension n \times (k*m)

  • Base: The baseline design matrix, dimension n \times p

hrf_basis

A T \times m matrix of HRF basis functions

hrf_ref

A length-T vector representing a reference HRF shape

maxit

Maximum number of L-BFGS-B iterations (default 100)

Details

This is the “Rank-1 GLM with Separate Designs” approach (sometimes called the Mumford method). We partition xdat$X into k sub-designs, each n \times m. For each voxel, we remove the baseline using lsfit and call r1_glms_betas to solve for the event-wise betas under a rank-1 HRF constraint.

Value

A list containing:

beta_matrix

A k \times nvox matrix of estimated condition amplitudes

estimated_hrf

A T \times nvox matrix of the per-voxel estimated HRF shape


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