a general statistical analysis for fmri data · a general statistical analysis for fmri data ......

15
A General Statistical Analysis for fMRI Data K. J. Worsley,* , ² C. H. Liao,* J. Aston,* , ² , ‡ V. Petre,² G. H. Duncan,§ F. Morales,\ and A. C. Evans² *Department of Mathematics and Statistics and ²Montreal Neurological Institute, McGill University, Canada; Imperial College, London, United Kingdom; §Centre de Recherche en Sciences Neurologiques, Universite ´ de Montre ´al, Canada; and \Cuban Neuroscience Center, Havana, Cuba Received December 6, 2000 We propose a method for the statistical analysis of fMRI data that seeks a compromise between effi- ciency, generality, validity, simplicity, and execution speed. The main differences between this analysis and previous ones are: a simple bias reduction and regu- larization for voxel-wise autoregressive model param- eters; the combination of effects and their estimated standard deviations across different runs/sessions/ subjects via a hierarchical random effects analysis us- ing the EM algorithm; overcoming the problem of a small number of runs/session/subjects using a regular- ized variance ratio to increase the degrees of freedom. © 2002 Elsevier Science Key Words: fMRI; hemodynamic response function; linear regression; random effects; EM algorithm; bias reduction. 1. INTRODUCTION Many methods are available for the statistical anal- ysis of fMRI data that range from a simple linear model for the response and a global first-order autoregressive model for the temporal errors (SPM’99), to a more sophisticated nonlinear model for the response with a local state space model for the temporal errors (Purdon et al., 2001). We have tried to strike a compromise that is fast, efficient, general and valid. The main novel features of our method are: (1) a method for reducing the bias in estimating the parameters of an autoregres- sive model for the errors; (2) combining the results from separate runs/sessions/subjects using a simple random effects model estimated by the EM algorithm; (3) modifications to the EM algorithm to reduce bias and increase execution speed; (4) spatial regularization of the random effect to increase the degrees of freedom; (5) careful use of caching to improve the overall execu- tion speed of the computer code. The result is a set of four MATLAB functions, collec- tively known as fmristat, which are freely available on the web at http://www.math.mcgill.ca/ keith/fmristat. The first, fmridesign, sets up the design matrix for a linear model by convolving the external stimulus with a pre-specified hemodynamic response function (HRF). The second, fmrilm, fits the linear model to a single run of fMRI data allowing for spatially varying autocorrelated errors. It can also es- timate the voxel-wise delay of the HRF, but this will be described elsewhere (Liao et al., 2000). The third, multistat, combines the output from separate anal- yses of fmrilm from different runs within a session, different sessions on the same subject, and across sub- jects within a population, using a type of random ef- fects analysis. Finally, tstat_threshold sets the threshold for peak and cluster size detection using random field theory (Worsley et al., 1996; Cao, 1999). The analysis is presented schematically in Fig. 1. Note that spatial normalization to register the im- ages to an atlas standard, such as Tailarach coordi- nates, is only performed on the output from each ses- sion (since the subject will have moved), not on the original data nor the output from each run (since the subject is presumably still in the same position in the scanner). This reduces the amount of normalization considerably. Motion correction during the run is per- formed by different software in our lab. This paper is organized as follows. Section 2 defines the linear model for fMRI data, then the statistical analysis of a single run is presented in Section 3. Re- sults from multiple runs, sessions and subjects are analysed in Section 4. Peak and cluster size detection are discussed in Section 5. The methods are applied to a data set in Section 6, and some discussion and con- cluding comments are given in Sections 7 and 8. 2. DESIGNING THE STATISTICAL MODEL 2.1. Modeling the Signal The first step in the statistical analysis of fMRI data is to build a model of how the data responds to an external stimulus. Suppose the (noise-free) fMRI re- sponse at a particular voxel at time t is given by x(t), and the external stimulus is given by s(t). The corre- sponding fMRI response is not instantaneous; there is a blurring and a delay of the peak response by about NeuroImage 15, 1–15 (2002) doi:10.1006/nimg.2001.0933, available online at http://www.idealibrary.com on 1 1053-8119/02 $35.00 © 2002 Elsevier Science All rights reserved.

Upload: others

Post on 16-Dec-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

NeuroImage 15, 1–15 (2002)doi:10.1006/nimg.2001.0933, available online at http://www.idealibrary.com on

A General Statistical Analysis for fMRI DataK. J. Worsley,*,† C. H. Liao,* J. Aston,*,†,‡ V. Petre,† G. H. Duncan,§ F. Morales,\ and A. C. Evans†

*Department of Mathematics and Statistics and †Montreal Neurological Institute, McGill University, Canada; ‡Imperial College,London, United Kingdom; §Centre de Recherche en Sciences Neurologiques, Universite de Montreal, Canada;

and \Cuban Neuroscience Center, Havana, Cuba

Received December 6, 2000

We propose a method for the statistical analysis offMRI data that seeks a compromise between effi-ciency, generality, validity, simplicity, and executionspeed. The main differences between this analysis andprevious ones are: a simple bias reduction and regu-larization for voxel-wise autoregressive model param-eters; the combination of effects and their estimatedstandard deviations across different runs/sessions/subjects via a hierarchical random effects analysis us-ing the EM algorithm; overcoming the problem of asmall number of runs/session/subjects using a regular-ized variance ratio to increase the degrees of freedom.© 2002 Elsevier Science

Key Words: fMRI; hemodynamic response function;linear regression; random effects; EM algorithm; biasreduction.

1. INTRODUCTION

Many methods are available for the statistical anal-ysis of fMRI data that range from a simple linear modelfor the response and a global first-order autoregressivemodel for the temporal errors (SPM’99), to a moresophisticated nonlinear model for the response with alocal state space model for the temporal errors (Purdonet al., 2001). We have tried to strike a compromise thatis fast, efficient, general and valid. The main novelfeatures of our method are: (1) a method for reducingthe bias in estimating the parameters of an autoregres-sive model for the errors; (2) combining the resultsfrom separate runs/sessions/subjects using a simplerandom effects model estimated by the EM algorithm;(3) modifications to the EM algorithm to reduce biasand increase execution speed; (4) spatial regularizationof the random effect to increase the degrees of freedom;(5) careful use of caching to improve the overall execu-tion speed of the computer code.

The result is a set of four MATLAB functions, collec-tively known as fmristat, which are freely availableon the web at http://www.math.mcgill.ca/keith/fmristat. The first, fmridesign, sets up thedesign matrix for a linear model by convolving the

1

external stimulus with a pre-specified hemodynamicresponse function (HRF). The second, fmrilm, fits thelinear model to a single run of fMRI data allowing forspatially varying autocorrelated errors. It can also es-timate the voxel-wise delay of the HRF, but this will bedescribed elsewhere (Liao et al., 2000). The third,multistat, combines the output from separate anal-yses of fmrilm from different runs within a session,different sessions on the same subject, and across sub-jects within a population, using a type of random ef-fects analysis. Finally, tstat_threshold sets thethreshold for peak and cluster size detection usingrandom field theory (Worsley et al., 1996; Cao, 1999).The analysis is presented schematically in Fig. 1.

Note that spatial normalization to register the im-ages to an atlas standard, such as Tailarach coordi-nates, is only performed on the output from each ses-sion (since the subject will have moved), not on theoriginal data nor the output from each run (since thesubject is presumably still in the same position in thescanner). This reduces the amount of normalizationconsiderably. Motion correction during the run is per-formed by different software in our lab.

This paper is organized as follows. Section 2 definesthe linear model for fMRI data, then the statisticalanalysis of a single run is presented in Section 3. Re-sults from multiple runs, sessions and subjects areanalysed in Section 4. Peak and cluster size detectionare discussed in Section 5. The methods are applied toa data set in Section 6, and some discussion and con-cluding comments are given in Sections 7 and 8.

2. DESIGNING THE STATISTICAL MODEL

2.1. Modeling the Signal

The first step in the statistical analysis of fMRI datais to build a model of how the data responds to anexternal stimulus. Suppose the (noise-free) fMRI re-sponse at a particular voxel at time t is given by x(t),and the external stimulus is given by s(t). The corre-sponding fMRI response is not instantaneous; there isa blurring and a delay of the peak response by about

1053-8119/02 $35.00© 2002 Elsevier Science

All rights reserved.

Page 2: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

2 WORSLEY ET AL.

6 s. The simplest way of capturing this is to assumethat the fMRI response depends on the external stim-ulus by convolution with a hemodynamic responsefunction h(t) as follows:

x~t! 5 E0

`

h~u!s~t 2 u!du. (1)

Several models for h(t) have been proposed. A simpleone is a gamma function (Lange and Zeger, 1997) or adifference of two gamma functions to model the slightintensity dip after the response has fallen back to zero(Friston et al., 1998). An example is the HRF availablein SPM’96:

h~t! 5 ~t/d1!a1exp~ 2 ~t 2 d1!/b1!

2 c~t/d ! a2exp~ 2 ~t 2 d !/b !),(2)

FIG. 1. Fmristat flow chart for the analysis of several runs (onT 5 E/S 5 T statistic.

2 2 2

where t is time in seconds, dj 5 ajbj is the time to thepeak, and a1 5 6, a2 5 12, b1 5 b2 5 0.9 seconds, andc 5 0.35 (Glover, 1999). This is then subsampled at then scan acquisition times t1, . . . , tn to give the responsexi 5 x(ti) at scan i.

The combined effect of k different stimuli types ondata in scan i, denoted by k different responses xi1, . . . ,xik is often assumed to be additive but with differentmultiplicative coefficients b1, . . . , bk that vary fromvoxel to voxel. The combined fMRI response is modeledas the linear model (Friston et al., 1995)

xi1b1 1 · · · 1 xikbk.

Some voxels in fMRI time series data show consid-erable drift over time. Drift can be either linear, or amore general slow variation. If drift is not removedthen it can either be confounded with the fMRI re-

ne session per subject); E 5 effect, S 5 standard deviation of effect,

ly o
Page 3: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

3STATISTICAL ANALYSIS FOR fMRI DATA

sponse, particularly if the stimuli vary slowly overtime, or it can add to the estimate of the random noise.The first causes bias in estimates of the effect of thestimuli, the second causes bias in the estimate of theerror of the estimated effect. Drift can be removedeither by high-pass filtering or by introducing low fre-quency drift terms, such as cosines, polynomials, orsplines, into the linear model. The cosine transformbasis functions used in SPM’99 have zero slope at theends of the sequence, which is not realistic, so we use apolynomial drift. All of these can be written as extra“responses” xi, k 1 1, . . . , xi, m at time i, and added to thelinear model. For example, a polynomial drift of orderq can be removed by adding to the linear model xi, k 1 1 1 j

5 tij, j 5 0, 1, . . . , q, m 5 k 1 1 1 q. Finally a random

error ei is added to obtain the observed fMRI data, Yi, attime index i:

Yi 5 xi1b1 1 · · · 1 xikbkfMRI response

1 xi,k11bk11 1 · · · 1 ximbmdrift

1ei

(3)5 x*ib 1 ei,

where x 5 (x , . . . , x )9 and b 5 (b , . . . , b )9.

FIG. 2. Estimation of the autocorrelation r: (a) unsmoothed, nobias. Note the biased autocorrelation of '20.05 outside the brain in

i i1 im i1 im

2.2. Modeling the Noise

The errors are not independent in time; typically thecorrelation between scans 3 s apart can be as high as0.4, particularly in cortical regions (Fig. 2c). Usingleast squares model fitting to estimate each b, andneglecting to take the correlation structure into ac-count, or using the wrong correlation model, can causebiases in the estimated error of the estimates of b, butit does not bias the estimate of b itself, which willalways be unbiased though perhaps less efficient (i.e.,more variable). The simplest model of the temporalcorrelation structure is the first order autoregressivemodel (Bullmore et al., 1996), in which the scans areequally spaced in time and we suppose that the errorfrom the previous scan is combined with fresh noise toproduce the error for the current scan:

ei 5 rei21 1 ji1,

where uru , 1 and ji1 is a sequence of independent andidentically distributed normal random variables withmean 0 and standard deviation s1, i.e., ji1 ; N(0, s1

2)(known as “white noise”). The resulting autocorrelationat lag l is

Cor~e , e ! 5 r ulu.

s reduction; (b) smoothed, no bias reduction; (c) smoothed, reduced), which goes to '0 after bias reduction in (c).

bia(b

i i2l

Page 4: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

4 WORSLEY ET AL.

This can be extended to autoregressive models of orderp, denoted by AR(p), specified by

ei 5 a1ei21 1 a2ei22 1 · · · 1 apei2p 1 ji1,

in which the autocorrelation structure is more com-plex, including oscillatory terms as well as exponentialdecay. To take into account white noise from the scan-ner, Purdon et al. (2001) has extended the AR(1) modelto add a second independent white noise term. This isa special type of state space model which are extremelypowerful at capturing complex dynamic relationships,including drift.

2.3. Fmridesign

The MATLAB function fmridesign takes as inputthe stimuli s(t) (defined by onset time, duration andheight) and the parameters of the HRF (2), calculatesthe responses x(t), then samples them at the slice ac-quisition times to produce a different set of regressorvariables xi for each slice. Our analysis uses regressorstailored to each slice whereas SPM simply augmentsthe regressors to include extra covariates that modelslight shifts in time induced by sequential slice acqui-sition. In other words, fmridesign specifies a singlebut slice specific regressor, whereas SPM augments thedesign matrix to include an extra regressor that re-tains the same design matrix for all voxels. This is thenused as input to fmrilm to be described next.

3. LINEAR MODELS ANALYSIS OF A SINGLE RUN

3.1. Estimating the Signal Parameters

Worsley and Friston (1995) proposed estimating b in(3) by least squares, then correcting the inference forcorrelated errors. A general unbiased estimator of bcan be found by first multiplying the vector of observa-tions Y 5 (Y1, . . . , Yn)9 and its model (3) by an n 3 nmatrix A then estimating the parameters by leastsquares. The fully efficient (most accurate, i.e., mini-mum variance) estimator of b is obtained by choosingA 5 V21/2, where Vs2 is the n 3 n variance matrix of Y,so that the variance of the resulting errors is propor-tional to the identity matrix, equivalent to “whitening”the errors. SPM’99 chooses A to suppress both high andlow frequencies. The removal of low frequencies imple-ments an approximate whitening of the data and re-moval of high frequencies renders the resulting infer-ence more robust to misspecification of the correlationstructure (Friston et al., 2000). SPM’99 adopts anAR(1) model for the original data, whose parameter r isassumed to be constant across the brain, rather thanvarying spatially as proposed in our method. Althoughthere is considerable evidence that r is not constant(see Fig. 2 and Purdon et al., 2001), the robustness

conferred by temporal smoothing appears to alleviatethis problem.

Here we propose the fully efficient, pre-whiteningstrategy with a spatially varying A 5 V21/2. Doing thisin practice can be very time consuming if it is repeatedat every voxel. Fortunately there are computationallyefficient ways of finding V21/2 if the errors are gener-ated by an AR(p) process (see Appendix A.3) or a statespace model (using the Kalman filter). For the AR(1)model, for example, pre-whitening the data and regres-sors is accomplished by

Y1 5 Y1, Yi 5 ~Yi 2 rYi21!/Î1 2 r 2,(4)

x1 5 x1, xi 5 ~xi 2 rxi21!/Î1 2 r 2,

i 5 2, . . . , n, so that the model becomes

Yi 5 x9ib 1 ji, (5)

where ji ; N(0, s2) independently and s2 5 s12/(1 2 r2).

Denoting the pseudoinverse by 1, the least squaresestimator of b in (5) is

b 5 X 1Y, (6)

where X 5 (x1, . . . , xn)9 is the transformed designmatrix, and Y 5 (Y1, . . . , Yn)9 is the transformed ob-servation vector.

3.2. Estimating the Noise Parameters

The vector of residuals r 5 (r1, . . . , rn)9 is

r 5 Y 2 Xb 5 RY, R 5 I 2 XX1.

If V is known, then s2 is estimated unbiasedly by

s 2 5 r*r/n, (7)

where n 5 n 2 rank(X) is the degrees of freedom, equalto n 2 m if the model is not over parameterized.

We now turn to estimating the parameters in thecorrelation structure V. We first estimate b by leastsquares for the original untransformed data (3), that iswith A equal to the identity matrix. While not fullyefficient, this estimator is unbiased, so that the resid-uals have zero expectation and a correlation structureapproximately equal to that of the errors e. The param-eter of the AR(1) model can then be estimated by thesample autocorrelation of the residuals

r 5 Oi52

n

riri21/Oi51

n

r i2.

Page 5: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

5STATISTICAL ANALYSIS FOR fMRI DATA

Replacing r in (4) by the reduced bias, regularized r(see Section 3.3 below) produces approximately whit-ened data that are used to produce the final estimatorsof b and s from (6) and (7). This could be iterated byreestimating r, r, then b, but in practice this does notseem to give much improvement.

3.3. Bias Reduction and Regularization of theAutocorrelations

A slight bias creeps into the estimator r due to thecorrelation of the residuals induced by removing anestimated linear effect from the observations. This isbecause the variance matrix of the residuals is RVRs2,which is not the same as the variance matrix of theerrors Vs2. Typically r is about 0.05 lower than ex-pected.

Note that SPM’99 estimates a global value of r basedon pooling the sample autocorrelations of the raw dataafter global normalization, so this problem is avoided.This is at the expense of introducing another potentialsource of bias due to the fact that signal and driftterms, not removed by global normalisation, have notbeen removed. However, only a small fraction of thevoxels should show signal or drift, so when the auto-correlation is pooled across voxels this source of biaswill be reduced. Bias due to using a global instead of alocal estimate of r still remains, but this bias is reducedby the band-pass filtering strategy as noted in Section3.1.

One method of obtaining less biased voxel-wise vari-ance parameters is to use restricted or residual maxi-mum likelihood (REML) estimates (Harville, 1974),but this involves costly iterations. Instead we propose asimple, fast, non-iterative method based on equatingsample autocovariances to their approximate expecta-tions. Details are given in Appendix A.1. Inserting theresulting autocorrelations into the Yule–Walker equa-tions gives estimates of the AR(p) parameters, whichwere shown by simulation to have much reduced bias.However, before doing this, we propose regularizingthe autocorrelations as described next.

In practice the estimated autocorrelation parame-ters vary considerably about their true values. Evenwhen no correlation is present, it is well known thatthe standard deviation of the sample autocorrelation ris about 1/=n, or about 0.1 for typical runs of n 5 100scans. This is quite large compared to the true corre-lations that range from 0 to 0.4. Some method of reg-ularization that reduces this variability seems desir-able. Purdon et al. (1998) achieve this by spatialsmoothing of the likelihood before estimating the au-tocorrelation parameters. Instead we propose the sim-pler method of spatial smoothing of the (reduced bias)sample autocorrelations. This reduces the variabilityconsiderably, at the cost of a slight increase in bias.

The extension of these ideas to AR(p) models is treatedin Appendix A.

3.4. Inference for Effects

An effect of interest, such as a difference betweenstimuli, can be specified by cb, where c is a row-vectorof m contrasts. It is estimated by

E 5 cb, (8)

with estimated standard deviation

S 5 icX 1is. (9)

To detect the effect, we test the null hypothesis thatthe effect is zero. The test statistic is the T statistic

T 5 E/S,

which has an approximate t distribution with n degreesof freedom (exact if V is known) when there is no effect(cb 5 0). To detect more than one effect at the sametime, that is, if c is a matrix with rank k, the T statisticis replaced by an F statistic defined by

F 5 E9~cX 1~cX 1!9! 21E/~ks 2!,

which has an approximate F distribution with k and ndegrees of freedom (exact if V is known) when there areno effects.

3.5. Fmrilm

The methods described in this section have beenimplemented in the MATLAB function fmrilm (fMRIlinear model). This takes as input the design matri-ces from fmridesign and adds polynomial trends.Note that the polynomial trends are not smoothed bythe hemodynamic response function, so that the con-stant term codes for a rest or baseline condition thatis supposed to exist before scanning started. Codingfor a baseline “stimulus” is not necessary unless thebaseline is a separate stimulus, such as a cross on acomputer screen, that was first presented the mo-ment that scanning commenced. If this is the case,the constant term (in the drift) codes for the smallamount of background effect that is carried over bythe HRF from before scanning started, and should beignored.

In a first pass through the data, the reduced bias ris calculated from the least-squares residuals ofthe untransformed model. This is regularized by spa-tial smoothing with a 15 mm (default) FWHM Gauss-ian kernel. In a second pass through the data, thefMRI data and design matrix are whitened using r

Page 6: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

6 WORSLEY ET AL.

and the final estimates of b and s are calculated,then effects E, their standard errors S, and T and Ftest statistics. Note that calculation of S by (9)avoids further matrix inversion. Note also that thesesteps give the right answers even if the design ma-trix has less than full rank (i.e., the model is over-parameterized).

Computations were reduced as follows. Note thatin this second pass, a separate pseudoinverse mustbe calculated at each voxel, because the whiteneddesign matrix depends on the autocorrelation pa-rameter r. To cut down computations, r was roundedto the nearest 0.01 from 21 to 1, and a separatepseudo-inverse was calculated and cached for eachrounded r in the slice. This reduced the number ofpseudo-inverse calculations by a factor of about 100.Unfortunately this trick does not work for AR(2)models or higher because two or more parametersare involved. However the whitening step was effi-ciently coded by a very small number of MATLABcommands (see Appendix A.3).

The execution time of fmrilm is about 6 min for 118scans 3 13 slices 3 128 3 128 pixels per slice on a 450MHz Pentium, but 22 minutes for fitting an AR(2)model, increasing by 4 min per extra order of the AR(p)model, to over 50 min for an AR(8) model.

FIG. 3. Estimation of the AR(4) parameters, smoothed, reduceobviously the first, but the presence of some anatomical details in th

4. COMBINING MULTIPLE RUNS, SESSIONS,OR SUBJECTS

4.1. The Random Effects Model

The next step is to combine the effects and theirstandard errors from different runs in the same ses-sion, then different sessions on the same subject, thendifferent subjects from a population. This makes ourinference applicable to a population, rather than just asingle case. Let us start by combining n* runs; thecombination of sessions and subjects is similar. Let Ej

denote the effect on run j from (8), and let Sj denote itsstandard deviation from (9), j 5 1, . . . , n*.

Besides simply averaging the effects, we may alsowish to compare one set of runs with another underdifferent experimental conditions, or we may wish toremove a trend in the effects taken over time. This canbe simply captured by another vector of regressor vari-ables denoted by zj measured on run j. We then assumethat Ej is a random variable whose expectation is alinear model z9jg in the regressor variables.

In order to extend our inference to randomly sam-pled runs, rather than further scans within the samerun, we assume that the effect has two components ofvariability. The first is the variance Sj

2 from furtherscans within the same run, regarded as fixed. The

ias: (a) a1, (b) a2, (c) a3, (d) a4. The most important parameter isigher order parameters suggests that they are not identically zero.

d be h

Page 7: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

7STATISTICAL ANALYSIS FOR fMRI DATA

second is a random effects variance srandom2 from the

variability of the expected Ej (found by infinitely longruns) from run to run. The random effects model(strictly speaking a mixed effects model) is then

Ej 5 z9jg 1 hj, (10)

where hj is normally distributed with zero mean andvariance Sj

2 1 srandom2 independently for j 5 1, . . . , n*.

Note that setting srandom2 5 0 produces a fixed effects

analysis.

4.2. Estimating the Parameters

If srandom2 were known, then the best estimator of g is

obtained by weighted least squares with weights in-versely proportional to Sj

2 1 srandom2 . The fixed effects

estimates would use weights inversely proportional toSj

2, which was the basis of our first version of multi-stat (Worsley et al., 2000). If srandom

2 is unknown thenwe can estimate g and srandom

2 by restricted maximumlikelihood (REML) (Harville, 1974), which gives lessbiased variance estimates than maximum likelihood(ML). However, the fact that the error variances addmeans that there is no analytic expression for the

FIG. 4. T statistics for the hot–warm contrast by fitting differen2, (d) p 5 4. The T statistics for the AR(1), AR(2), and AR(4) models amodel is adequate for this data. In contrast, assuming independent

REML or ML estimators, so we must resort to iterativealgorithms. Stability is more important than speed ofconvergence since it is not easy to monitor the algo-rithm at each voxel, so we have chosen the EM algo-rithm, which always produces positive estimates ofvariance components. The details are given in Appen-dix B.

When the random effect is small, the EM algorithmis known to be slow to converge and it produces se-verely biased estimates. This is because the EM algo-rithm always returns a positive estimate of srandom

2 evenwhen the true value is zero. To overcome this, wesubtract Smin

2 5 minjSj2 from each Sj

2, which gives anequivalent model for Ej with variance

~S j2 2 S min

2 ! 1 ~s random2 1 S min

2 !.

We now use the EM algorithm to estimate the un-known parameter s*random

2 5 (srandom2 1 Smin

2 ). The startingvalues are the least squares estimates assuming thatSj 5 0. Convergence is faster because s*random

2 is furtherfrom zero than srandom

2 ; 10 iterations appear to beenough. Finally we subtract Smin

2 from s*random2 to get an

estimator of srandom2 that appears to be almost unbiased

for simulated data.

der AR(p) models: (a) independent errors (p 5 0), (b) p 5 1, (c) p 5lmost identical, differing by less than 1%, suggesting that the AR(1)ors gives a T statistic that is 12% too large.

t orre aerr

Page 8: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

8 WORSLEY ET AL.

4.3. Regularizing the Random Effects Variance

A serious problem with the above analysis is that thenumber of runs, sessions or subjects is usually smalland so the estimate of srandom

2 is highly variable, whichresults in a low effective degrees of freedom n* for theestimated variance Var(g). For example, if all standarddeviations Sj were equal, so that the variance of eacheffect Ej is an unknown but equal constant, then it canbe shown that the degrees of freedom is n* 5 n* 2 p*,where p* 5 rank(Z) and Z 5 (z1

. . . zn*)9. In our appli-cation, the n* 5 4 runs were averaged to give n* 5 3 df.This is particularly serious when detecting local max-ima by thresholding an image of T statistics, becausethe corrected threshold can become extremely high,making it very difficult to detect a signal that is reallypresent (Worsley et al., 1996).

Notice that the image of srandom2 (Fig. 6a) is very noisy

(due to the low degrees of freedom) but that it doescontain substantial anatomical structure. This sameanatomical structure is also evident in the image of thefixed effects standard deviation, sfixed

2 (Fig. 6b), ob-tained as

s fixed2 5 O

jnjS j

2/nfixed,

where nj is the degrees of freedom of Sj and nfixed 5 ¥jnj

is the degrees of freedom of the fixed effects analysis.Notice that the image of the fixed effects standarddeviation has much less noise since it has high degreesof freedom coming from the large number of scans foreach run. We can therefore use the fixed effects stan-dard deviation as a template for a better estimate ofthe random effects standard deviation. To see this,consider the ratio of the two:

t 2 5s fixed

2 1 s random2

s fixed2

,

which has much less anatomical structure (Fig. 6d).We could therefore reduce the noise in t2 by spatialsmoothing (Fig. 6e), then multiply back by the fixedeffects standard deviation to get an improved estima-tor of the random effects standard deviation that hashigher effective degrees of freedom (Fig. 6c):

TAB

The Effective Degrees of Freedom n* for an Experof n 5 118 Scans (n 5 112 df ), a

Random effectsanalysis

FWHM of smoothing filter wratio (mm) 0Effective degrees of freedom n* 3

s random2 5 smooth~t2! 3 s fixed

2 2 s fixed2

5 smoothSs random2

s fixed2 D 3 s fixed

2 .(11)

This can then be used in place of srandom2 to get a better

estimator of g and its standard deviation.Note that no smoothing gives a purely random ef-

fects analysis, whereas smoothing with an infinitelywide filter, so that the variance ratio is 1 everywhere,produces a purely fixed effects analysis. The desiredamount of smoothing can be determined by the desireddegrees of freedom, which we look at next.

4.4. Estimating the Degrees of Freedom

By smoothing the variance ratio image t2 we de-crease its variability at the expense of a possible slightincrease in bias. The actual decrease in variability ismeasured by its effective degrees of freedom. To get arough estimate of this, suppose that the FWHM of thefilter is wratio and that the spatial correlation function ofeach Ej is a Gaussian function with FWHM weffect. InAppendix C we show that the effective degrees of free-dom of the regularized variance ratio is approximatedby

nratio 5 n*S2Swratio

weffectD2

1 1D 3/2

.

The final effective degrees of freedom of the standarddeviation S*, denoted by n*, is estimated by

1

n*5

1

nratio1

1

nfixed. (12)

Thus the wratio parameter acts as a convenient way ofproviding an analysis midway between a random ef-fects and a fixed effects analysis. Table 1 shows thedegrees of freedom for some typical values of theamount of smoothing. Setting wratio 5 0 (no smoothing)produces a random effects analysis; setting wratio 5 `,which smoothes the variance ratio to one everywhere,produces a fixed effects analysis. In practice, we choosew to produce a final n*, which is at least 100, so that

1

nt with n* 5 4 runs (n* 5 3 degrees of freedom),weffect 5 6 mm Effective FWHM

Variability7 BiasFixed effects

analysis

10 15 20 25 `45 112 192 264 448

LE

imend

511

ratio

Page 9: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

9STATISTICAL ANALYSIS FOR fMRI DATA

errors in its estimation do not greatly affect the distri-bution of test statistics.

Finally, effects defined by contrasts b in g can beestimated by E* 5 bg with standard deviation S* 5

Î bVar(g)b9. The T statistic T* 5 E*/S*, with a nomi-nal n* df, can then be used to detect such an effect.

4.5. Multistat

The analysis of this section is done by multistat. Ittakes as input the output effect Ej and standard devi-ation Sj images from fmrilm, together with their de-grees of freedom nj. If the standard deviation imagesare not provided them multistat assumes they are 0with nfixed 5 `. The FWHM of the input effects weffect issupplied, usually estimated by the FWHM of the rawdata. Finally the FWHM for smoothing the varianceratio wratio should be chosen to give at least 100 df (thedefault is 15 mm).

The variance ratio t is smoothed in 3-D, then thefinal g and its estimated variance is obtained byweighted least squares using weights 1/(Sj

2 1 srandom2 )

(see Appendix B). On rare occasions near scanner ar-tifacts outside the brain, the weights can be negative;see Appendix D for the reason and a fix. Output is theeffective degrees of freedom n*, the effect E* and itsstandard deviation S*, which can be used as input tofurther runs of multistat as illustrated in Fig. 1. Runtime is very quick, less than 1 min for averaging fourruns on a 450 MHz Pentium.

5. DETECTING ACTIVATED REGIONS

The final step in the analysis is to detect the regionsactivated by the stimulus, or contrast in the stimuli.This part is almost identical to that employed by SPM.Tstat_threshold finds the threshold for the maxi-mum of a T statistic image for a given P value, 0.05 bydefault. Input is the volume of the search region, thevolume of one voxel, the FWHM of the data, and thedegrees of freedom.

This calculation is fairly robust to the shape of theregion so it assumes the search region is spherical,which gives a threshold that is a lower bound for re-gions with the same volume (Worsley et al., 1996).Sometimes if the FWHM is small relative to the voxelvolume, a Bonferroni reduction gives a lower thresholdthan the random field theory, so tstat_thresholdtakes the smallest of the two. The threshold is alsorobust against non-stationarity of the data (Worsley etal., 1999), so the fact that a different design matrix isused for each slice, and different autocorrelations areused to pre-whiten the data, does not greatly affect thethreshold.

Finally a critical cluster size for the T statisticsgreater than an input threshold is calculated usingnew results from random field theory (Cao, 1999). The

critical cluster size is sensitive to nonstationarity, so itmust be used with caution. A better method, based oncluster resels (Worsley et al., 1999), has not yet beenimplemented.

6. AN EMPIRICAL ILLUSTRATION

The methods described in this paper were applied toan fMRI experiment on pain perception (Chen et al.,2000). After 9 s of rest, a subject was given a painfulheat stimulus (49°C) to the left forearm for 9 s, followedby 9 s of rest, then a warm stimulus (35°C) for 9 s,repeated 10 times for 6 min in total. During this timethe subject was scanned every TR 5 3 s (120 scans)using a Siemens 1.5 T machine and 13 slices of 128 3128 pixel BOLD images were obtained. The first twoscans were discarded, leaving n 5 118 scans as data.Fmridesign was used to set up 13 different design

matrices for the 13 slices, offset by the 0.12 s inter-leaved slice acquisition times. Two box functions werecreated for the hot and warm stimuli as describedabove, then convolved with the HRF (2) and sampled atthe slice acquisition times.Fmrilm was then used to analyze a single run with

cubic drift removal (q 5 3) and 15 mm FWHM smooth-ing of the reduced bias autocorrelation parameter fromthe fitted AR(1) model. Execution time was 6 min on a450 MHz Pentium. We are interested in a pain effect,so a contrast of c 5 (1 21 0 0 0 0) was used to comparethe hot stimulus (1) with the warm stimulus (21),ignoring the 4 coefficients of the cubic drift (0 values).

The two stages of smoothing and bias reduction forthe autocorrelation are shown on one slice in Fig. 2.Without smoothing and bias reduction, the image isquite noisy (60.1) but with clear evidence of highercorrelations in cortical areas than in white matter oroutside the brain (Fig. 2a). After smoothing (Fig. 2b)the noise is much reduced and there is now clear evi-dence of a negative bias of '20.05 outside the brainwhere the autocorrelation should be zero. This is suc-cessfully removed by bias reduction (Fig. 2c) to revealcorrelations ranging from 0.2 to 0.4 in cortical areas.Fmrilm was used to fit an AR(4) error model (30 min

execution time), and the resulting 15 mm smoothedreduced bias parameter estimates of a1, a2, a3, a4 areshown in Fig. 3. The first coefficient a1 clearly domi-nates, but the presence of nonzero values in the higherorder parameters cannot be entirely ruled out, sincesome anatomical structure is clearly discernible partic-ularly in a2. To see if this has any effect on the result-ing T statistics for the pain effect, we calculated Tstatistics for AR(p) models with p 5 1, 2, 4. As isevident in Fig. 4, there is almost no difference in the Tstatistics. Even for an AR(16) model, the T statisticswere almost identical (not shown). However, if thecorrelation is ignored and the data are assumed to beindependent then the T statistic is about 11% higher

Page 10: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

10 WORSLEY ET AL.

than it should be (Fig. 4a). Thus the AR(1) model seemsto be adequate for this experiment.

The experiment was repeated in n* 5 4 consecutiveruns separated by 18, 7, and 4 min, respectively. Therun just analysed was in fact the second run, chosen to

FIG. 5. Statistics from fmrilm for four different consecutiveestimated effect of the hot–warm stimulus E, (b) its estimated stancolumn) was used for Figs. 2–4.

FIG. 6. Regularizing the variance ratio: (a) the fixed 1 random efixed effects standard deviation sfixed (448 df ), (c) the regularized fix(fixed 1 random)/fixed standard deviations t 5 sfixed 1 random/sfixed ('3df ), (f) t for different subjects. Note that the standard deviation ratioover runs, except in frontal and anterior regions. However, there is

illustrate a high pain effect. Using an AR(1) model, theresulting effects E1–E4, standard errors S1–S4 and Tstatistics Tj 5 Ej/Sj with n 5 118 2 6 5 112 df are givenin Fig. 5. There is some evidence for a pain effect in thecentral region, but the most striking feature is the

s and their combination using multistat (left to right). (a) therd deviation S, (c) the T statistic T 5 E/S. The second run (second

cts standard deviation, sfixed 1 random 5 = sfixed2 1 srandom

2 (3 df ), (b) the1 random standard deviation tsfixed ('112 df ). (d) The ratio of the

), (e) the smoothed standard deviation ratio t 5 =smooth(t2) ('149is roughly equal to one, indicating little evidence for a random effectong evidence for a random effect over subjects (f).

runda

ffeeddf(e)str

Page 11: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

11STATISTICAL ANALYSIS FOR fMRI DATA

considerable variability from run to run; the first runin particular seems to show very little evidence for apain effect in this slice.Multistat was used to average the effects using

covariates zj 5 1 and the final effect E*, standarddeviation S* and T statistic T* are shown in the lastcolumn of Fig. 5. The method of regularizing the vari-ance ratio is illustrated in Fig. 6. The random effectsstandard deviation (Fig. 6a) is very noisy due to its lowdegrees of freedom (n* 5 n* 2 p* 5 4 2 1 5 3). It showssimilar spatial structure to the fixed effects standarddeviation (Fig. 6b) that has very high degrees of free-dom (nfixed 5 n*n 5 448). The ratio of the two (Fig. 6d)is much more stationary, though still very noisy. Aftersmoothing (Fig. 6e), it is apparent that the ratio is closeto one outside the brain and in many brain regions as

FIG. 7. Final thresholded T statistic T* for detecting the hot–warthreshold of 4.86 found using tstat_threshold.

well, indicating little evidence for a random effect, ex-cept in frontal and anterior regions where it attainsvalues as high as 1.6. This means that in these regionsthe variability of the effects is up to 60% higher thantheir variability due to the scans. If we had just done afixed effects analysis, our T statistics would be up to60% higher in these regions than they should be. Tocorrect for this, we multiply the smoothed ratio by thefixed effects standard deviation to obtain a roughlyunbiased estimate of the variance (Fig. 6c). Note thatthe standard deviation is up to 60% higher in frontaland anterior regions to compensate for the randomeffects. The random effects due to repetitions over sub-jects is much higher (Fig. 6f), up to 3 times the fixedeffects. The smoothing increases the degrees of free-dom of the variance ratio from 3 to 149, then the

timulus by combining the four runs and thresholding at the P , 0.05

m s
Page 12: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

12 WORSLEY ET AL.

multiplication back by the fixed effects standard devi-ation decreases it to approximately n* 5 112 df (middlecolumn, Table 1).Tstat_threshold with a search volume of 1000 cc,

a voxel volume of 38.4 cc, 6 mm FWHM smoothing, andn* 5 112 df gives a P 5 0.05 threshold of 4.86. Even ifthe degrees of freedom is in error by a factor of 2, itdoes not greatly affect the critical threshold. The finalthresholded T statistic is shown in Fig. 7.

7. DISCUSSION

Many of the methods presented in this paper arerefinements on existing ones: bias reduction and spa-tial regularization of temporal autocorrelation param-eters; model fitting by prewhitening; careful coding toreduce computations. The main novel contribution is asimple random effects analysis for combining runs/sessions/subjects, including spatial regularization toincrease the degrees of freedom. When we talk aboutan under-estimation of the standard error this is fromthe perspective of a random or “mixed” effects analysis.In our experience the sorts of questions addressed byneuroimaging experiments call for a mixed effectsanalysis so that the inferences can be generalised tothe population from which the subjects were drawn.Our novel approach embodies some sensible con-straints that allow for a much better estimation of theerror variance required for mixed effects inferences.This better estimation improves sensitivity. However,it should be noted that this does not preclude an im-portant role for fixed effects analyses, which are verysensitive but can only be generalised to the subjectsstudied. Fixed effects analyses have to be used in thecontext of single case studies (e.g., patients with spe-cific brain lesions) or when the functional anatomy ofinterest does replicate from subject to subject (e.g.,ocular dominance columns in visual cortex). Ignoringthe random effect and treating the effects as fixed couldlead to standard errors that are three times too small(see Fig. 6f) resulting in T statistics that are threetimes too large. On the other hand, using a purelyrandom effects analysis gives very small degrees offreedom resulting in less sensitivity. For example, theP 5 0.001 point of the t distribution with 3 df is T 510.2, more than three times larger than with 100 df(T 5 3.2). The method proposed here is a compromisebetween the two that maintains high degrees of free-dom while still capturing most of the random effect.

There are many approximations leading to the resultfor the effective degrees of freedom n*, so the trueeffective degrees of freedom could be quite different. Bychoosing the amount of smoothing to give a calculatedeffective degrees of freedom of at least 100, we hope tocover up for any errors in this approximation. Even ifthe calculated n* is off by a factor of two, it will not

greatly affect our inference, since T statistics withmore than 50 df are very close to a standard Gaussian.

Regularization by spatial smoothing is used first tostabilize the autocorrelation, and second to increasethe degrees of freedom of the random effects analysis.Obviously this introduces some bias due for instance tosmoothing data outside the brain with data inside thebrain. This could be alleviated by smoothing along thecortical surface, either by spatially informed basisfunctions (Kiebel et al., 2000) or by cortical surfacemapping (Andrade et al., 2001).

It is the last stage when multistat is used to com-bine the subjects that has the greatest influence indetermining the final standard deviation of the effect.This is because the random subject effect is muchlarger than the random effects from previous stages.This means that if the cost of the experiment is pro-portional to total scanner time, then it is better toenroll more subjects and scan them less, than to in-crease the number sessions, runs, or scans per run onfewer subjects. In reality there is additional cost asso-ciated with recruiting and training new subjects, sosome compromise between the two is better.

8. CONCLUSION

We have presented a simple method for the statisti-cal analysis of fMRI data that does a reasonable job ofgiving valid results. We have paid particular attentionto the combination of results from separate runs, ses-sions and subjects, because it is the latter in particularthat has the greatest affect on our final inference aboutthe nature of the fMRI response in the population.There are many places where this could be improved,at the expense of more computation time. For example,Volterra kernels for nonlinear hemodynamics are notyet available in fmristat. However fmrilm can es-timate the delay of the HRF at every voxel and forevery stimulus (Liao et al., 2000). This makes it possi-ble to produce separate images of the delay of the HRFand its standard deviation for each stimulus, thatthemselves can be combined over runs, sessions andsubjects using multistat.

The user will naturally ask how this method differsfrom SPM’99. The differences are given in Table 2.They are all small but in each case we think the choiceswe have made may be slightly better. The similaritiesare many: both methods use linear models with a sim-ple autocorrelation structure, drift removal by additivetrends, and the same random field theory to detectactivated regions. Both methods are written in MATLABand are freely available on the web. The differences areperhaps more of taste than substance, so we expectboth methods to give roughly similar results.Fmristat is only in the early stages of development.

It only does a simple statistical analysis of fMRI data,and other functions such as motion correction and spa-

Page 13: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

13STATISTICAL ANALYSIS FOR fMRI DATA

tial normalization are done by other software in ourlab. It now has a GUI, and it reads and writes bothanalyze and minc formatted image files (the latteraccessed through the emma toolbox available for Win-dows, Linux and SGI IRIX (Morales et al., 2000)).

SPM’99 is a much more complete package with aGUI, a help line, and a course, that analyses muchmore than fMRI data. Future releases of SPM willremove temporal smoothing or low pass filtering as anoption and replace the AR(1) model on the original datawith AR(1) plus white noise estimated using the EMalgorithm. SPM’01 will still retain a global parameterfor the serial correlations and continue to use the leastsquares estimator as described in Worsley and Friston(1995) and in Section 3.1 for simplicity and flexibility(Friston, personal communication).

APPENDIX

A. Extensions to AR(p) Models

A.1. Bias reduction of the autocovariances. Let Dl

be a matrix of zeros with ones on the lth upper off-diagonal, so that the expectation of the lag l autoco-variance, 0 # l # p, is

E~r*Dlr! 5 tr~RDlRV!s2

< tr~RDl!n0 1 Oj51

p

tr~RDlR~Dj 1 D*j!!nj,

where Vs2 is approximated by nj on the jth off-diago-nal, 0 # j # p, and zero elsewhere. Equating r9Dlr to itsapproximate expectation for 0 # l # p gives p 1 1linear equations in p 1 1 unknowns, which can besolved for nj, 0 # j # p, giving approximate unbiasedestimators of the autocovariances. To do this, let

TAB

Comparison of SP

Feature SPM’

Different slice acquisition times Augments the model withTrend removal Low frequency cosines (flaTemporal correlation AR(1), global parameter, b

necessaryEstimation of effects Band pass filter, then leas

correction for temporal

Rationale More robust, but lower de

Random effects No regularization, low deg

Maps of estimates andstandarderrors of the delay ofthe HRF

No

al 5 Oi5l11

n

riri2l, mlj 5 Htr~RDl! j 5 0,tr~RDlR~Dj 1 D*j!! 1 # j # p,

a 5 1a0···ap2 , M 5 1m00. . .m0p······mp0. . .mpp2 , v 5 1

n0

···np2 .

The estimated covariances are

v 5 M21a,

and the autocorrelations at lag l are estimated by

rl 5 nl/n0.

Note that M21 does not depend on the voxels, so it onlyneeds to be calculated once per slice, making this biasreduction step very fast.

A.2. Smoothing the autoregressive model. As ex-plained in Section 3.3, the autocorrelation coefficientfor an AR(1) model is smoothed spatially to reduce itsvariability. For an AR(p) model there are two choices:smooth the autocorrelations, or smooth the elements ofV21/2 (for AR(1) models they are identical). We havedecided to take the first approach and smooth the au-tocorrelations. The main reason for this is that it re-quires less effort, since there are only p autocorrela-tions but there are (p 1 1)(p 1 2)/2 different elementsthat define V21/2 (see Section A.3). Moreover it is easy toshow that if the filter is positive, then smoothed auto-correlations still define a positive definite correlationmatrix, hence a stationary AR(p) model.

The reason is this. Let f be the filter, normalized tointegrate to 1, and let C the Toeplitz matrix whosediagonals are r 5 (1 r . . . r ), that is the reduced bias

2

9 and fmristat

fmristat

emporal derivative Shifts the modelt the ends) Polynomials (free at the ends)reduction not AR(p), local parameters with bias

reduction and spatial regularizationquares, thenrelation

Prewhiten the data, then leastsquares (no further correctionsneeded)

es of freedom More accurate (if model is correct),higher degrees of freedom

s of freedom Spatial regularization, high degrees offreedom

Yes

LE

M’9

99

a tt aias

t scor

gre

ree

1 p

Page 14: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

14 WORSLEY ET AL.

correlations of the first p 1 1 scans. We shall assumethat C is still positive definite, even after bias reduc-tion. Let f p C be the convolution of f with each elementof C. Consider an arbitrary quadratic form in f p C:

a*~ f p C!a 5 f p ~a*Ca! $ 0

since f $ 0 and a*Ca $ 0. Hence the smoothed corre-lation matrix f p C is a positive definite Toeplitz matrix.The diagonal elements are 1, so it is a correlationmatrix and can be used to derive a stationary AR(p)model.

A.3. A simple method of whitening. The whiten-ing matrix V21/2 can be found directly from the auto-correlations, without solving the Yule–Walker equa-tions, by the following piece of MATLAB code. The rowvector rho contains the regularized autocorrelations (1r1

. . . rp), n contains n and Vmhalf contains V21/2:

[Ainvt posdef]5chol(toeplitz(rho));p15size(Ainvt,1);A5inv(Ainvt’);Vmhalf5toeplitz([A(p1,p1:21:1)zeros(1,n2p1)],zeros(1,n));Vmhalf(1:p1,1:p1)5A;

Note that this code allows for the possibility that due toround-off error the estimated AR(p) model is nonsta-tionary (p1 , p 1 1), in which case the higher order ARcoefficients are set to zero and an AR(p1 2 1) model isfitted instead.

B. The EM Algorithm

The EM algorithm for REML estimates is laid out inLaird, Lange, and Stram (1987), specifically Eq. (3.8).Let S 5 diag(S1, . . . , Sn*) and I be the n* 3 n* identitymatrix. Then the variance matrix of the effects vectorE 5 (E1, . . . , En*)9 is, from (10),

S 5 S 2 1 Is random2 . (13)

Define the weighted residual matrix

RS 5 S21 2 S 21Z~Z*S21Z!1Z*S21, (14)

where Z 5 (z1. . . zn*)9. We start with an initial value of

srandom2 5 E*RIE/n* based on assuming that the fixed

effects variances are zero. The updated estimate is

s random2 5 ~s random

2 ~p* 1 tr~S2RS!!

1 s random4 E*RS

2E!n*.(15)

Replace srandom2 with srandom

2 in (13) and iterate (13–15) toconvergence. In practice 10 iterations appears to beenough.

After convergence and regularization as described inSection 4.3, step (13) is repeated with srandom

2 replacedby srandom

2 , then the estimate of g is

g 5 ~Z* S21Z!1Z* S21E,

and its estimated variance matrix is

Var~g! 5 ~Z* S21Z!1.

C. The Effective Degrees of Freedom of the SmoothedVariance Ratio

We start by supposing that standard deviations Sj

are all fixed and equal, and that srandom2 5 0. In this case

the model (10) is equivalent to a model with constantunknown variance so that n*t2 has a x2 distributionwith n* degrees of freedom at every point u in D di-mensional space. Suppose the error in the effect hj ismodeled as D dimensional white noise convolved with aGaussian kernel f(u) with variance veffect 5 weffect

2 /(8 log 2):

f~u! 5 f~u; veffect!

where

f~u; v! 5 ~2pv!2D/2e 2iui 2/~2v!

is the D dimensional Gaussian density with mean zeroand variance v. Then the spatial correlation function ofhj is

c~u! 5~ f p f !~u!

~ f p f !~0!5 ~2p2veffect!

D/2f~u; 2veffect!

where p denotes convolution. Then it can be shown(Adler, 1981, Chapter 7) that the spatial covariancefunction of the squared error is

2c~u!2 5 2~2pveffect!D/2f~u; veffect!.

Now t2 has the same distribution as a linear function ofthe average of n* independent hj

2 and so its spatialcovariance function is 2c(u)2/n*. If t2 is convolved witha Gaussian filter

g~u! 5 f~u; vratio!

with variance vratio 5 wratio2 /(8 log 2), to give t2, then the

covariance function of t2 is that of t2 convolved with(g p g)(u), namely

Page 15: A General Statistical Analysis for fMRI Data · A General Statistical Analysis for fMRI Data ... (SPM’99), to a more sophisticated nonlinear model for the response with a local

15STATISTICAL ANALYSIS FOR fMRI DATA

2~c 2 p g p g!~u!/n* 5 2~2pveffect!D/2f~u; veffect 1 2vratio!.

Thus the variance of t2 is the spatial covariance func-tion at u 5 0 namely

Var~t2! 5 2~c 2 p g p g!~0!/n*

5 2~veffect/~veffect 1 2vratio!!D/2/n*.

Finally the effective degrees of freedom of the varianceratio is, by the Satterthwaite approximation,

n* 52E~t2! 2

Var~t2!5 n*S2Swratio

weffectD2

1 1D D/2

.

Since this result does not depend on the value of Sj, itis also true if Sj is random. This result is expected tohold approximately when the Sjs are unequal and non-stationary, provided their expectations are fairlysmooth.

The last question is the effective degrees of freedomof sfixed

2 1 srandom2 , equal to the product of t2 and sfixed

2 .These two factors are approximately independent. Thedegrees of freedom of sfixed

2 is nfixed. The coefficients ofvariation (percentage errors) of the product of indepen-dent quantities add (approximately, if they are small),so the reciprocals of the effective degrees of freedomadd (by the Satterthwaite approximation), which leadsto the final result (12).

D. Positivity of the Regularized Mixed EffectsVariance

Even though the estimated effects variance Sj2 1

srandom2 is guaranteed to be positive at each voxel (even if

the EM algorithm has not converged), we discoveredthat after spatial smoothing Sj

2 1 srandom2 from (11) can

sometimes be negative. This is because srandom2 can be

negative, particularly when there is a small randomeffect; recall that this ensures that srandom

2 is unbiased.The problem happens in scanner artifacts outside thebrain near the border of regions of exact zeros, and wehave never observed it in the brain itself. To overcomethis, we cannot simply set negative variances to ‘miss-ing’ values, since there are always some very smallvariances at neighboring voxels that give very large Tstatistics. Instead, multistat uses the maximum ofSj

2 1 srandom2 and Sj

2/4 as the variance of Ej wheneverwratio . 0. This guarantees that the standard deviationof Ej is never less than half the fixed effects standarddeviation. It does not alter any of the voxel values inany of the figures.

REFERENCES

Adler, R. J. 1981. The Geometry of Random Fields. Wiley, New York.Andrade, A., Kherif, F., Mangin, J-F., Paradis, A-L., Worsley, K. J.,

Simon, O., Dehaene, S., Le Bihan, D., and Poline, J-B. 2001.Detection of fMRI activation using cortical surface mapping. Hu-man Brain Mapping 12: 79–93.

Bullmore, E. T., Brammer, M. J., Williams, S. C. R., Rabe-Hesketh,S., Janot, N., David, A. S., Mellers, J. D. C., Howard, R., and Sham,P. 1996. Statistical methods of estimation and inference for func-tional MR image analysis. Magn. Reson. Med. 35: 261–277.

Cao, J. 1999. The size of the connected components of excursion setsof x2, t and F fields. Adv. Appl. Prob. 31: 579–595.

Chen, J-I., Ha, B., Bushnell, M. C., Pike, B., and Duncan, G. H. 2000.Differentiating pain- and innocuous mechanical-related activationof human S1 cortex using temporal analysis of fMRI. In prepara-tion.

Friston, K. J., Holmes, A. P., Worsley, K. J., Poline, J-B., Frith, C. D.,and Frackowiak, R. S. J. 1995. Statistical parametric maps infunctional imaging: A general linear approach. Hum. Brain Mapp.2: 189–210.

Friston, K. J., Fletcher, P., Josephs, O., Holmes, A. P., Rugg, M. D.,and Turner, R. 1998. Event-related fMRI: Characterising differen-tial responses. NeuroImage 7: 30–40.

Friston, K. J., Josephs, O., Zarahn, E., Holmes, A. P., Rouquette, S.,and Poline, J-B. 2000. To smooth or not to smooth? Bias andefficiency in fMRI time series analysis. NeuroImage 12: 196–208.

Glover, G. H. 1999. Deconvolution of impulse response in event-related BOLD fMRI. NeuroImage 9: 416–429.

Harville, D. A. 1974. Bayesian inference for variance componentsusing only error contrasts. Biometrika 61: 383–385.

Kiebel, S. J., Goebel, R., and Friston, K. J. 2000. Anatomicallyinformed basis functions. NeuroImage 11: 656–667.

Laird, N. M., Lange, N., and Stram, D. 1987. Maximum likelihoodcomputations with repeated measures: Application of the EM al-gorithm. J. Am. Stat. Assoc. 82: 97–105.

Lange, N., and Zeger, S. L. 1997. Non-linear Fourier time seriesanalysis for human brain mapping by functional magnetic reso-nance imaging (with Discussion). Appl. Statist. 46: 1–29.

Liao, C. H., Worsley, K. J., Poline, J-B., Duncan, G. H., and Evans,A. C. 2000. Estimating the delay of the hemodynamic response infMRI data. NeuroImage, submitted.

Morales, F., MacDonald, D., Valdes, P., and Evans, A. C. 2000.Transferring the Montreal Neurological Institute image process-ing tools to a Windows platform. NeuroImage 11: S922.

Purdon, P. L., Solo, V., Weisskoff, R. M., and Brown, E. 2001. Locallyregularized spatiotemporal modeling and model comparison forfunctional MRI. NeuroImage 14: 912–923.

Worsley, K. J., and Friston, K. J. 1995. Analysis of fMRI time-seriesrevisited—Again. NeuroImage 2: 173–181.

Worsley, K. J., Marrett, S., Neelin, P., Vandal, A. C., Friston, K. J.,and Evans, A. C. 1996. A unified statistical approach for determin-ing significant signals in images of cerebral activation. Hum.Brain Mapp. 4: 58–73.

Worsley, K. J., Andermann, M., Koulis, T., MacDonald, D., andEvans, A. C. 1999. Detecting changes in non-isotropic images.Hum. Brain Mapp. 8: 98–101.

Worsley, K. J., Liao, C., Grabove, M., Petre, V., Ha, B., and Evans,A. C. 2000. A general statistical analysis for fMRI data. Neuro-Image 11: S648.