fit_bayesglm {BayesfMRI} | R Documentation |
fit_bayesglm
Description
Performs spatial Bayesian GLM for task fMRI activation
Usage
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
)
Arguments
BOLD , design , nuisance |
Session-length list of numeric matrices/arrays, each with volumes along the first dimension. |
scrub |
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. |
spatial |
Gives the spatial information:
For voxel data, a list of six: |
scale_BOLD |
Controls scaling the BOLD response at each location.
|
Bayes |
Perform spatial Bayesian modeling? Default: |
hyperpriors |
Should informative or default non-informative hyperpriors be assumed on SPDE hyperparameters? |
ar_order |
(For prewhitening) The order of the autoregressive (AR) model
to use for prewhitening. If For multi-session modeling, note that a single AR model is used; its coefficients will be the average estimate from each session. |
ar_smooth |
(For prewhitening) The FWHM parameter for spatially
smoothing the coefficient estimates for the AR model to use for
prewhitening. Recall that
|
aic |
(For prewhitening) Use the Akaike information criterion (AIC) to
select AR model orders between |
n_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 |
|
meanTol , varTol |
Tolerance for mean, variance and SNR 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
.- field_estimates
The estimated coefficients for the Bayesian model.
- result_classical
Results from the classical model: field estimates, field standard error estimates, residuals, degrees of freedom, and the mask.
- mesh
The model mesh.
- mask
A mask of
mesh
indicating the locations insidemesh
.- design
The design matrix, after centering and scaling, but before any nuisance regression or prewhitening.
- field_names
The names of the fields.
- 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.