hyperparamest computes the MLEs (maximum likelihood estimates) of the hyperparameters of the BHMSMA model using an empirical Bayes approach for multi-subject or single subject analyses, and returns the hyperparameters estimates along with their covariance matrix estimate (see References).

hyperparamest(n, grid, waveletcoefmat, analysis)

Arguments

n

Number of subjects.

grid

The number of voxels in one row (or, one column) of the brain slice of interest. Must be a power of 2. The total number of voxels is grid^2. The maximum value of grid for this package is 512.

waveletcoefmat

A matrix of dimension (n,grid^2-1), containing for each subject the wavelet coefficients of all levels stacked together (by the increasing order of resolution level).

analysis

"multi" or "single", depending on whether performing multi-subject analysis or single subject analysis.

Value

A list containing the following.

hyperparam

A vector containing the estimates of the six hyperparameters of the BHMSMA model.

hyperparamVar

Estimated covariance matrix of the hyperparameters.

References

Sanyal, Nilotpal, and Ferreira, Marco A.R. (2012). Bayesian hierarchical multi-subject multiscale analysis of functional MRI data. Neuroimage, 63, 3, 1519-1531.

Author

Nilotpal Sanyal, Marco Ferreira

Maintainer: Nilotpal Sanyal <nilotpal.sanyal@gmail.com>

Examples

set.seed(1)
n <- 3
grid <- 8
waveletcoefmat <- array(dim=c(n,grid^2-1),
  rnorm(n*(grid^2-1)))
analysis <- "multi"
hyperest <- hyperparamest(n,grid,waveletcoefmat,analysis)
hyperest$hyperparam
#> [1]  1.00000  1.00000  1.00000  1.00000  0.00000 28.37678
# [1]  1.00000  1.00000  1.00000  1.00000  0.00000 28.37678