Learn R Programming

BayesBrainMap (version 0.1.3)

EM_BrainMap: EM Algorithms for Bayesian brain maps

Description

EM Algorithms for Bayesian brain maps

Usage

EM_BrainMap.spatial(
  prior_mean,
  prior_var,
  meshes,
  BOLD,
  theta0,
  C_diag,
  H,
  Hinv,
  maxiter = 100,
  usePar = FALSE,
  epsilon = 0.001,
  reduce_dim = TRUE,
  verbose = FALSE
)

EM_BrainMap.independent( prior_mean, prior_var, BOLD, theta0, C_diag, H, Hinv, maxiter = 100, epsilon = 0.001, reduce_dim = FALSE, usePar = FALSE, verbose )

Value

A list: theta (list of final parameter estimates), subjNet_mean (estimates of subject-level networks), subjNet_var (variance of subject-level networks, for non-spatial model) or subjNet_cov (covariance matrix of subject-level networks, for spatial model -- note that only diagonal and values for neighbors are computed), and success (flag indicating convergence (TRUE) or not (FALSE))

Arguments

prior_mean

(\(V \times Q\) matrix) mean maps for each network in the prior, where \(Q\) is the number of networks, \(V=nvox\) is the number of data locations.

prior_var

(\(V \times Q\) matrix) between-subject variance maps for each network in prior

meshes

NULL for spatial independence model, otherwise a list of objects of class "BrainMap_mesh" containing the triangular mesh (see make_mesh) for each brain structure.

BOLD

(\(V \times Q\) matrix) dimension-reduced fMRI data

theta0

(list) initial guess at parameter values: A (\(QxQ\) mixing matrix), nu0_sq (residual variance from first level) and (for spatial model only) kappa (SPDE smoothness parameter for each network map)

C_diag

(\(Qx1\)) diagonal elements of matrix proportional to residual variance.

H, Hinv

For dimension reduction of the spatial Bayesian brain map model, which assumes that all networks have the same smoothness parameter, \(\kappa\)

maxiter

Maximum number of EM iterations. Default: 100.

usePar

Parallelize the computation? Default: FALSE. Can be the number of cores to use or TRUE, which will use the number available minus two. Not yet implemented for spatial Bayesian brain map.

epsilon

Smallest proportion change between iterations. Default: 0.001.

reduce_dim

Reduce the temporal dimension of the data using PCA? Default: TRUE for the spatial EM algorithm, and FALSE for the independent EM algorithm.

verbose

If TRUE, display progress of algorithm. Default: FALSE.

Details

EM_BrainMap.spatial implements the expectation-maximization (EM) algorithm described in Mejia et al. (2019+) for estimating the subject-level networks and unknown parameters in the Bayesian brain map model with spatial priors on subject effects.

In both models, if original fMRI timeseries has covariance \(\sigma^2 I_T\), the prewhitened timeseries achieved by premultiplying by (\(QxT\)) matrix \(H\) from PCA has diagonal covariance \(\sigma^2HH'\), so C_diag is \(diag(HH')\).