Description Usage Arguments Details Value Note Author(s) See Also Examples
Plots the traces of posterior probabilities during an inhibMCMC run.
1 | plot_mcmctraces(ret, thin = 1)
|
ret |
List. Object returned by |
thin |
The thinning interval between consecutive observations. |
Plot the MCMC posterior traces of all runs during inhibMCMC inference. Uses a thinning interval
defined in thin
.
none
Uses the coda
package and its mcmc object and plot functions.
Christian Bender
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 31 | ## Not run:
## load package
library(ddepn)
library(multicore)
library(coda)
## sample a network and data
set.seed(1234)
n <- 6
signet <- signalnetwork(n=n, nstim=2, cstim=0, prop.inh=0.2)
phit <- signet$phi
stimuli <- signet$stimuli
dataset <- makedata(phit, stimuli, mu.bg=1200, sd.bg=400, mu.signal.a=2000, sd.signal.a=1000)
## use original network as prior matrix
## reset all entries for inhibiting edges
## to -1
B <- phit
B[B==2] <- -1
## perform inhibMCMC inference, using 4 CPU cores to get 4 MCMC chains
ret <- ddepn(dataset$datx, phiorig=phit, maxiterations=300, burnin=50,
plotresults=FALSE, inference="mcmc",
usebics=FALSE, priortype="laplaceinhib", lambda=0.01, B=B,
multicores=TRUE, cores=4)
plot_mcmctraces(ret,thin=1)
plot_mcmctraces(ret,thin=10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.