Functional magnetic resonance imaging (fMRI) is a new technique for studyin
g the workings of the active human brain. During an fMRI experiment, a sequ
ence of magnetic resonance images is acquired while the subject performs sp
ecific behavioral tasks. Changes in the measured signal can be used to iden
tify and characterize the brain activity resulting from task performance. T
he data obtained from an fMRI experiment are a realization of a complex spa
tiotemporal process with many sources of variation, both biological and tec
hnological. This article describes a nonlinear Bayesian hierarchical model
for fMRI data and presents inferential methods that enable investigators to
directly target their scientific questions of interest, many of which are
inaccessible to current methods. The article describes optimization and pos
terior sampling techniques to fit the model, both of which must be applied
many thousands of times for a single dataset. The model is used to analyze
data from a psychological experiment and to test a specific prediction of a
cognitive theory.