Description Usage Arguments Details Value Note References See Also Examples
Compute Gelman's potential scale reduction to estimate convergence in inhibMCMC.
1 | gelman_diag(ret)
|
ret |
List. Object returned by |
The function is a wrapper calling the gelman.diag
function from package coda
.
The result of the gelman.diag
function.
Note that multiple chains have to be performed to use this diagnostic.
Gelman, A., Carlin, JB., Stern, HS., Rubin, DB.: Bayesian Data Analysis, 2nd edition, Chapman & Hall/CRC, chapter 11.6, pp294-295.
coda package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
library(ddepn)
set.seed(12345)
n <- 6
signet <- signalnetwork(n=n, nstim=2, cstim=0, prop.inh=0.2)
net <- signet$phi
stimuli <- signet$stimuli
weights <- signet$weights
## sample data
dataset <- makedata(net, stimuli, mu.bg=1200, sd.bg=400, mu.signal.a=2000, sd.signal.a=1000)
data <- dataset$datx
# use the original network as prior probability matrix
B <- net
B[B==2] <- -1
# construct a prior matrix with uniform probabilities for each edge
if(require(multicore)) {
ret <- ddepn(data, phiorig=net, inference="mcmc",
maxiterations=3000, burnin=1000,
usebics=FALSE, lambda=0.01, B=B,
multicores=TRUE, cores=4, priortype="laplaceinhib")
}
## now produce the convergence diagnostic
gelman_diag(ret)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.