Learn R Programming

BiDAG (version 2.1.4)

getDAG: Extracting adjacency matrix (DAG) from MCMC object

Description

This function extracts an adjacency matrix of a maximum scoring DAG from the result of the MCMC run.

Usage

getDAG(x, amat = TRUE, cp = FALSE)

Value

adjacency matrix of a maximum scoring DAG (or CPDAG) discovered/sampled in one MCMC run

Arguments

x

object of class 'orderMCMC','partitionMCMC' or 'iterativeMCMC'

amat

logical, when TRUE adjacency matrix is returned and object of class 'graphNEL' otherwise

cp

logical, when TRUE the CPDAG (equivalence class) is returned and DAG otherwise; FALSE by default

Examples

Run this code
myscore<-scoreparameters("bge", Boston)
if (FALSE) {
itfit<-learnBN(myscore,algorithm="orderIter")
maxEC<-getDAG(itfit,cp=TRUE)
}

Run the code above in your browser using DataLab