gelman_diag: Convergence check by Gelman's potential scale reduction.

Description Usage Arguments Details Value Note References See Also Examples

Description

Compute Gelman's potential scale reduction to estimate convergence in inhibMCMC.

Usage

1

Arguments

ret

List. Object returned by ddepn, when inhibMCMC was used as inference method.

Details

The function is a wrapper calling the gelman.diag function from package coda.

Value

The result of the gelman.diag function.

Note

Note that multiple chains have to be performed to use this diagnostic.

References

Gelman, A., Carlin, JB., Stern, HS., Rubin, DB.: Bayesian Data Analysis, 2nd edition, Chapman & Hall/CRC, chapter 11.6, pp294-295.

See Also

coda package.

Examples

 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)

ddepn documentation built on May 2, 2019, 4:42 p.m.