Learn R Programming

cudaBayesreg (version 0.2-1)

cudaMultireg.slice: CUDA Parallel Implementation of a Bayesian Multilevel Model for fMRI Data Analysis

Description

cudaMultireg.slice This function provides an interface to a CUDA implementation of a Bayesian multilevel model for the analysis of brain fMRI data.

Usage

cudaMultireg.slice(slicedata, R, keep = 5, nu.e = 3, savesim = T,
             fsave = "/tmp/simultest.sav")

Arguments

slicedata
list(slice=slice, niislicets=niislicets, mask=mask, dsgn=dsgn).
R
number of MCMC draws.
keep
MCMC thinning parameter: keep every keepth draw (def: 5).
nu.e
d.f. parameter for regression error variance prior (def: 3).
savesim
save MCMC simulation, (T,F) (def: TRUE).
fsave
filename for output of MCMC simulation (def: "/tmp/simultest.sav").

Value

  • a list containing
  • betadrawnreg x nvar x R/keep array of individual regression coef draws
  • taudrawR/keep x nreg array of error variance draws
  • DeltadrawR/keep x nz x nvar array of Deltadraws
  • VbetadrawR/keep x nvar*nvar array of Vbeta draws

concept

  • bayes
  • MCMC
  • Gibbs Sampling
  • hierarchical models
  • linear model

Details

The statistical model implemented in CUDA was specified as a Gibbs Sampler for hierarchical linear models with a normal prior (see references below). The main computational work is done in parallel on a CUDA capable GPU. Each thread is responsible for fitting a general linear model at each voxel. The CUDA implementation has the following system requirements: nvcc NVIDIA Cuda Compiler driver, g++ GNU compiler (nvcc compatible version). The package includes source code files to build the libraries "libcutil.so" and "newmat11.so". The first, is a shared version of the utility library used by the NVIDIA GPU Computing SDK software (see cudaBayesreg/src/Makefile for configuration). The second, is a matrix library by R. B. Davies used by the package's host C++ code.

References

Adelino Ferreira da Silva, A Bayesian Multilevel Model for fMRI Data Analysis, submitted for publication. Rossi, Allenby and McCulloch, Bayesian Statistics and Marketing, Chapter 3. http://faculty.chicagogsb.edu/peter.rossi/research/bsm.html Davies, R.B. (1994) Writing a matrix package in C++. In OON-SKI'94: The second annual object-oriented numerics conference, pp 207-213. Rogue Wave Software, Corvallis. http://www.robertnz.net/cpp_site.html.

See Also

read.fmrisample premask pmeans.hcoef regpostsim plot.hcoef.post post.simul.hist post.simul.betadraw post.ppm post.tseries

Examples

Run this code
slicedata <- read.fmrisample(slice=3)
fsave <- "/tmp/simultest.sav"
out <- cudaMultireg.slice(slicedata, R=2000, keep=5, nu.e=3, fsave=fsave );
post.ppm(out=out, slicedata=slicedata, vreg=2)
post.ppm(out=out, slicedata=slicedata, vreg=4)

Run the code above in your browser using DataLab