Skip to contents

Builds the per-subject baseline_model (from the template's baseline_spec, the dataset's sampling frame, and any nuisance regressors) and combines it with the event model into an fmri_model.

Usage

build_model(job, dataset = realize_dataset(job))

Arguments

job

An fmri_job.

dataset

The realized dataset (defaults to realize_dataset(job)).

Value

An fmri_model.

Details

Each contrast specification in the template's contrasts (e.g. the elements of a contrast_set()) is attached to the event term it resolves against, exactly as if it had been written in that term (hrf(..., contrasts = )). The fit therefore computes it like any formula contrast, under every estimation scope, and write_results() / reduce_write_results() write it.