Learn R Programming

cudaBayesreg (version 0.3-6)

pmeans.hcoef: Posterior mean for each regression variable

Description

pmeans.hcoef processes the MCMC simulation to evaluate the posterior mean of the regression variables.

Usage

pmeans.hcoef(x,burnin=trunc(.1*R))

Arguments

x
betadraw object generated by the MCMC simulation
burnin
n. of draws to burnin, def: .1*R

Value

  • pmeansPosterior Means of Coefficients

concept

  • MCMC
  • hierarchical model

Details

Post-process MCMC simulation

See Also

cudaMultireg.slice, read.fmrislice, regpostsim, post.simul.betadraw, post.simul.hist

Examples

Run this code
slicedata <- read.fmrislice(fbase="fmri", slice=3, swap=FALSE)
 ymaskdata <- premask(slicedata)
fsave <- "/tmp/simultest1.sav"
answ <- readline("Run MCMC simulation first ? ")
run <- FALSE
if (substr(answ, 1, 1) == "y") { run <- TRUE }
if(run) {
	out <- cudaMultireg.slice(slicedata, ymaskdata, R=2000, keep=5, nu.e=3, fsave=fsave,
		zprior=FALSE)
} else {
	load(file=fsave)
	cat("loaded",fsave,"\n")
}
pmeans <- pmeans.hcoef(out$betadraw)

Run the code above in your browser using DataLab