Performs spatial Bayesian GLM for task fMRI activation
fit_bayesglm(
BOLD,
design,
nuisance = NULL,
scrub = NULL,
spatial,
scale_BOLD = c("mean", "sd", "none"),
Bayes = TRUE,
hyperpriors = c("informative", "default"),
ar_order = 6,
ar_smooth = 5,
aic = FALSE,
n_threads = 4,
return_INLA = c("trimmed", "full", "minimal"),
verbose = 1,
meanTol = 1e-06,
varTol = 1e-06
)
A "BayesGLM"
object: a list with elements
The full result of the call to INLA::inla
.
The estimated coefficients for the Bayesian model.
Results from the classical model: field estimates, field standard error estimates, residuals, degrees of freedom, and the mask.
The model mesh.
A mask of mesh
indicating the locations inside mesh
.
The design matrix, after centering and scaling, but before any nuisance regression or prewhitening.
The names of the fields.
The names of the sessions.
Hyperparameter posterior densities.
Theta estimates from the Bayesian model.
For joint group modeling.
For joint group modeling.
For joint group modeling.
For joint group modeling: The BOLD data after any centering, scaling, nuisance regression, or prewhitening.
For joint group modeling: The design matrix after any centering, scaling, nuisance regression, or prewhitening.
Vectors of values across locations: phi
(AR coefficients averaged across sessions), sigma_sq
(residual variance averaged across sessions), and AIC (the maximum across sessions).
match.call() for this function call.
Session-length list of numeric matrices/arrays, each with volumes along the first dimension.
Session-length list of spike regressors: numeric matrices, with volumes along the first dimension, valued at 1 for scrubbed volumes and 0 otherwise.
Scrubbing is performed by incorporating spike regressors in the nuisance matrix during nuisance regression (in a simultaneous framework), and then removing the scrubbed timepoints from the resulting BOLD and design.
Gives the spatial information:
A list of two: vertices
\(V \times 3\) numeric matrix of vertex locations in XYZ coordinate space, and faces
, \(F \times 3\) matrix of positive integers defining the triangular faces.
Mask of locations with valid data.
For voxel data, a list of six:
3D array of labeled locations to include in the model.
Projection matrix to convert voxel indices to XYZ position. Can be NULL
.
XYZ units. Can be NULL
.
See documentation for BayesGLM
.
See documentation for BayesGLM
.
Controls scaling the BOLD response at each location.
Scale the data to percent local signal change.
Scale the data by local standard deviation.
Center the data but do not scale it.
Perform spatial Bayesian modeling? Default: TRUE
. If
FALSE
, only perform classical (massive univariate) modeling. (The classical GLM
result is always returned, whether Bayes
is TRUE
or FALSE
.)
Should informative or default non-informative hyperpriors be assumed on SPDE hyperparameters?
(For prewhitening) The order of the autoregressive (AR) model
to use for prewhitening. If 0
, do not prewhiten. Default: 6
.
For multi-session modeling, note that a single AR model is used; its coefficients will be the average estimate from each session.
(For prewhitening) The FWHM parameter for spatially
smoothing the coefficient estimates for the AR model to use for
prewhitening. Recall that
\(\sigma = \frac{FWHM}{2*sqrt(2*log(2)}\). Set to 0
to not smooth
the estimates. Default: 5
.
(For prewhitening) Use the Akaike information criterion (AIC) to
select AR model orders between 0
and ar_order
? Default:
FALSE
.
The maximum number of threads to use for parallel
computations: prewhitening parameter estimation, and the inla-program model
estimation. Default: 4
. Note that parallel prewhitening requires the
parallel
package.
Return the INLA model object? (It can be large.) Use
"trimmed"
(default) returns the results sufficient for
activations
and BayesGLM2
; "minimal"
returns enough for BayesGLM2
but not
activations
; "full"
returns the full inla
output.
1
(default) to print occasional updates during model
computation; 2
for occasional updates as well as running INLA in
verbose mode (if Bayes
), or 0
for no printed updates.
Tolerance for mean, variance and SNR of each data location.
Locations which do not meet these thresholds are masked out of the analysis.
Default: 1e-6
for mean and variance, 50
for SNR.
This function requires the INLA
package, which is not a CRAN package.
See https://www.r-inla.org/download-install for easy installation instructions.