postwaveletcoef.Rd
postwaveletcoef
computes posterior mean and posterior median of the wavelet coefficients of the BHMSMA model for each subject based on multi-subject or single subject analyses (see References).
postwaveletcoef(n, grid, waveletcoefmat, hyperparam,
pkljbar, analysis)
Number of subjects.
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.
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).
A vector containing the estimates of the six hyperparameters.
A matrix of dimension (n,grid^2-1)
, containing the piklj bar values.
"MSA" or "SSA", depending on whether performing multi-subject analysis or single subject analysis.
A list containing the following.
A matrix of size (n,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).
A matrix of size (n,grid^2-1)
, containing for each subject the posterior median of the wavelet coefficients of all levels stacked together.
Sanyal, Nilotpal, and Ferreira, Marco A.R. (2012). Bayesian hierarchical multi-subject multiscale analysis of functional MRI data. Neuroimage, 63, 3, 1519-1531.
set.seed(1)
n <- 3
grid <- 8
nsample <- 5
waveletcoefmat <- array(rnorm(n*(grid^2-1)),
dim=c(n,grid^2-1))
hyperparam <- rep(.2,6)
pkljbar <- array(runif(n*(grid^2-1)),
dim=c(n,grid^2-1))
analysis <- "multi"
postwavecoef <- postwaveletcoef(n,grid,waveletcoefmat,
hyperparam,pkljbar,analysis)
#> Error in post_wavelet_coef(grid, n, waveletcoefmat, pkljbar, C4, C5): object '_BHMSMAfMRI_post_wavelet_coef' not found
dim(postwavecoef$PostMeanWaveletCoef)
#> Error in eval(expr, envir, enclos): object 'postwavecoef' not found
#[1] 3 63