fmri.lm(data, z, actype = "accalc", hmax = 3.52, vtype = "var",
step = 0.01, contrast = c(1), vvector = c(1),
keep = "essential")cbeta in each voxelvvectorvvectoractype %in% c("ac", "accalc", "smooth")
an AR(1) model is fitted, in each voxel, to
the time series of residuals. The estimated AR-coefficient is corrected for bias.
If actype=="smooth"
the estimated AR-coefficients are spatially smoothed using bandwidth hmax.
If actype %in% c("ac", "smooth") the linear model is prewithened
using the estimated (smoothed) AR-coefficients. Parameter
and variance estimates are then obtained from the prewithened
data. The argument keep describes the amount of data which is
returned. If "essential" only the estimated effects
$$\tilde{\gamma}_i = C^T\tilde{\beta}_i$$
and their
estimated variances are returned. "all" gives the full data, including
residuals, temporal autocorrelation.
If vvector is given and has length greater than 1, the
covariance matrix for the stimuli given therein are returned
(varm) and vwghts contains an estimate for the ratio of
the variances of the parameter for the stimuli indicated in
vvector. cbeta then contains the corresponding parameter
estimates and thus is a vector of corresponding length in each voxel.Worsley, K.J., Liao, C., Aston, J., Petre, V., Duncan, G.H., Morales, F., Evans, A.C. (2002). A general statistical analysis for fMRI data. NeuroImage, 15:1-15.
fmri.design, fmri.stimulus# Example 1
data <- list(ttt=array(rnorm(32*32*32*107),c(32,32,32,107)),
mask=array(1,c(32,32,32)))
class(data) <- "fmri.data"
hrf <- fmri.stimulus(107, c(18, 48, 78), 15, 2)
z <- fmri.design(hrf,2)
model <- fmri.lm(data,z,keep="all")
plot(data$ttt[16,16,16,])
lines(data$ttt[16,16,16,] - model$res[16,16,16,],col=2)Run the code above in your browser using DataLab