postmixprob: Obtain estimates of the mixture probabilities defining the...

View source: R/BHMSMA.R

postmixprobR Documentation

Obtain estimates of the mixture probabilities defining the BHMSMA posterior wavelet coefficients distributions

Description

postmixprob computes the mixture probabilities (piklj.bar), which define the marginal posterior distribution of the wavelet coefficients of the BHMSMA model, using Newton Cotes algorithm for each subject based on multi-subject or single subject analyses, and returns the same (see References).

Usage

postmixprob(n, grid, waveletcoefmat, hyperparam, 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).

hyperparam

A vector containing the estimates of the six hyperparameters.

analysis

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

Value

A list containing the following.

pkljbar

A matrix of dimension (n,grid^2-1), containing the piklj bar values.

Author(s)

Nilotpal Sanyal, Marco Ferreira

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

References

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

See Also

waveletcoef, hyperparamest, postwaveletcoef

Examples

set.seed(1)
n <- 3
grid <- 8
waveletcoefmat <- matrix(nrow=n,ncol=grid^2-1)
for(i in 1:n) waveletcoefmat[i,] <- rnorm(grid^2-1)
hyperparam <- rep(.1,6)
analysis <- "multi"
pkljbar <- postmixprob(n,grid,waveletcoefmat,hyperparam,
  analysis)
dim(pkljbar$pkljbar)
#[1]  3 63

BHMSMAfMRI documentation built on Oct. 2, 2022, 9:05 a.m.