Learn R Programming

BiDAG (version 2.0.0)

plotpedges: Plotting posterior probabilities of single edges

Description

This function plots posterior probabilities of all possible edges in the graph as a function of MCMC iterations. It can be used for convergence diagnostics of MCMC sampling algorithms order MCMC and partition MCMC.

Usage

plotpedges(
  MCMCtrace,
  cutoff = 0.2,
  pdag = FALSE,
  onlyedges = NULL,
  highlight = NULL
)

Arguments

MCMCtrace

an object of class MCMCres

cutoff

number representing a threshold of posterior probability below which lines will not be plotted

pdag

logical, when true DAGs in a sample will be first coverted to CPDAGs

onlyedges

(optional) binary matrix, only edges corresponding to entries which equal 1 will be plotted

highlight

(optional) binary matrix, edges corresponding to entries which equal 1 are highlighted with "red"

Value

plots posterior probabilities of edges in the graph as a function of MCMC iterations

Examples

Run this code
# NOT RUN {
score100<-scoreparameters("bde", Asia[1:100,])
orderfit100<-orderMCMC(score100,plus1=TRUE)
# }
# NOT RUN {
score5000<-scoreparameters("bde", Asia)
orderfit5000<-orderMCMC(score5000,plus1=TRUE)
plotpedges(orderfit100, pdag=TRUE)
plotpedges(orderfit5000, pdag=TRUE)
# }

Run the code above in your browser using DataLab