postwaveletcoeff {BHMSMAfMRI} R Documentation

## Obtain posterior mean and posterior median of the wavelet coefficients using BHMSMA methodology.

### Description

Computes posterior mean and posterior median of the wavelet coefficients using BHMSMA methodology.

### Usage

```postwaveletcoeff(nsubject, grid, WaveletCoefficientMatrix, hyperparam,
pklj.bar, analysis)
```

### Arguments

 `nsubject` Number of subjects included in the analysis. `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 grid value for this package is 512. `WaveletCoefficientMatrix ` A matrix of dimension (nsubject, 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. `pklj.bar ` A matrix of dimension (nsubject, grid^2-1), containing the piklj bar values (see Reference for details). `analysis` "MSA" or "SSA", depending on whether performing multi-subject analysis or single subject analysis.

### Value

A list containing the following.

 `PostMeanWaveletCoeff ` A matrix of size (nsubject, grid^2-1), containing for each subject the posterior mean of the wavelet coefficients of all levels stacked together (by the increasing order of resolution level). `PostMedianWaveletCoeff ` A matrix of size (nsubject, grid^2-1), containing for each subject the posterior median of the wavelet coefficients of all levels stacked together.

### Author(s)

Nilotpal Sanyal <nsanyal@stanford.edu>, Marco Ferreira <marf@vt.edu>

### References

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

### Examples

```nsubject <- 3
grid <- 8
nsample <- 5
GLMCoeffStandardized <- array(rnorm(3*8*8),dim=c(3,8,8))
WaveletCoefficientMatrix <- array(rnorm(3*63),dim=c(3,63))
hyperparam <- rep(.2,6)
pklj.bar <- array(runif(3*63),dim=c(3,63))
analysis <- "multi"
post.waveletcoeff <- postwaveletcoeff(nsubject, grid, WaveletCoefficientMatrix,
hyperparam, pklj.bar, analysis)
dim(post.waveletcoeff\$PostMeanWaveletCoeff)
#[1]  3 63
```

[Package BHMSMAfMRI version 1.3 Index]