Learn R Programming

BiDAG (version 2.1.4)

getTrace: Extracting trace from MCMC object

Description

This function extracts a trace of

  • DAG scores

  • DAG adjacency matrices

  • orders

  • order scores

from the result of the MCMC run. Note that the last three options work only when the parameter 'scoreout' was set to TRUE.

Usage

getTrace(x, which = 0)

Value

a list or a vector of objects representing MCMC trace, depends on parameter 'which'; by default, the trace of DAG scores is returned

Arguments

x

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

which

integer, indication which trace is returned: DAG scores (which = 0), DAGs (which = 1), orders (which = 2), order scores (which = 3)

Examples

Run this code
myscore<-scoreparameters("bge",Boston)
if (FALSE) {
orderfit<-sampleBN(myscore,algorithm="order")
DAGscores<-getTrace(orderfit,which=0)
DAGtrace<-getTrace(orderfit,which=1)
orderscores<-getTrace(orderfit,which=3)
}

Run the code above in your browser using DataLab