BayesGLM {BayesfMRI} | R Documentation |
BayesGLM
Description
Performs spatial Bayesian GLM for fMRI task activation
Usage
BayesGLM(
data,
vertices = NULL,
faces = NULL,
mesh = NULL,
mask = NULL,
task_names = NULL,
session_names = NULL,
combine_sessions = TRUE,
scale_BOLD = c("auto", "mean", "sd", "none"),
scale_design = TRUE,
Bayes = TRUE,
ar_order = 6,
ar_smooth = 5,
aic = FALSE,
num.threads = 4,
return_INLA = c("trimmed", "full", "minimal"),
verbose = 1,
meanTol = 1e-06,
varTol = 1e-06
)
Arguments
data |
A list of sessions in the Note that the argument |
vertices , faces |
If
|
mesh |
If
|
mask |
(Optional) A length |
task_names |
(Optional) Names of tasks represented in design matrix. |
session_names |
(Optional, and only relevant for multi-session modeling)
Names of each session. Default: |
combine_sessions |
If multiple sessions are provided, should their data be combined and analyzed as a single session? If |
scale_BOLD |
Option for scaling the BOLD response.
|
scale_design |
Scale the design matrix by dividing each column by its
maximum and then subtracting the mean? Default: |
Bayes |
If |
ar_order |
(numeric) Controls prewhitening. If greater than zero, this
should be a number indicating the order of the autoregressive model to use
for prewhitening. If zero, do not prewhiten. Default: |
ar_smooth |
(numeric) FWHM parameter for smoothing the AR model
coefficient estimates for prewhitening. Remember that
|
aic |
Use the AIC to select AR model order between |
num.threads |
The maximum number of threads to use for parallel
computations: prewhitening parameter estimation, and the inla-program model
estimation. Default: |
return_INLA |
Return the INLA model object? (It can be large.) Use
|
verbose |
Should updates be printed? Use |
meanTol , varTol |
Tolerance for mean and variance of each data location.
Locations which do not meet these thresholds are masked out of the analysis.
Default: |
Value
A "BayesGLM"
object: a list with elements
- INLA_model_obj
The full result of the call to
INLA::inla
.- task_estimates
The task coefficients for the Bayesian model.
- result_classical
Results from the classical model: task estimates, task standard error estimates, residuals, degrees of freedom, and the mask.
- mesh
The model mesh including only the locations analyzed, i.e. within
mask
, without missing values, and meetingmeanTol
andvarTol
.- mesh_orig
The original mesh provided.
- mask
A mask of
mesh_orig
indicating the locations insidemesh
.- design
The design matrix, after centering and scaling, but before any nuisance regression or prewhitening.
- task_names
The names of the tasks.
- session_names
The names of the sessions.
- hyperpar_posteriors
Hyperparameter posterior densities.
- theta_estimates
Theta estimates from the Bayesian model.
- posterior_Sig_inv
For joint group modeling.
- mu_theta
For joint group modeling.
- Q_theta
For joint group modeling.
- y
For joint group modeling: The BOLD data after any centering, scaling, nuisance regression, or prewhitening.
- X
For joint group modeling: The design matrix after any centering, scaling, nuisance regression, or prewhitening.
- prewhiten_info
Vectors of values across locations:
phi
(AR coefficients averaged across sessions),sigma_sq
(residual variance averaged across sessions), and AIC (the maximum across sessions).- call
match.call() for this function call.
INLA Requirement
This function requires the INLA
package, which is not a CRAN package.
See https://www.r-inla.org/download-install for easy installation instructions.