Learn R Programming

cudaBayesreg (version 0.2-1)

regpostsim: Estimation of voxel activations

Description

regpostsim estimates voxel activation and plots the posterior distribution of a regression coefficient.

Usage

regpostsim(pmeans, vreg, plot=T)

Arguments

pmeans
Posterior Means of Coefficients as processed by pmeans.hcoef()
vreg
regression variable to process
plot
plot the histogram, (default=T)

concept

  • MCMC
  • plot
  • hierarchical model

Details

Estimate the active and non-active voxels based on the highest posterior density (HPD) of the coefficients simulated by the multilevel method. Plot the histogram of the posterior distribution of regression coefficient "vreg"

See Also

cudaMultireg.slice pmeans.hcoef 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"
answ <- readline("Run MCMC simulation first ? ")
if (substr(answ, 1, 1) == "y") { run <- TRUE }
else { run <- FALSE }
if(run) {
	out <- cudaMultireg.slice(slicedata, fsave=fsave )
} else {
	load(file=fsave)
	cat("loaded",fsave,"\n")
}
#
pmeans <- pmeans.hcoef(out$betadraw) 
px <- regpostsim(pmeans, vreg=2)
pm2 <- pmeans[,vreg]
spma <- px$spma # active voxels
spmn <- px$spmn # non-active voxels

Run the code above in your browser using DataLab