GBNOrder: Ordering GBN object

Description Usage Arguments Value Examples

Description

This function is used in the MCMC algorithm to order the GBN according to the new order found by the rmallows or rmallowsBlocks functions.

Usage

1
GBNOrder(GBN, ord)

Arguments

GBN

GBN - An object of class GBN.

ord

vector of integers - The new order of the GBN.

Value

The function returns an object of type GBN : the slots Weightmatrix, ResMean and ResSigma of the new GBN are ordered according to the order given by the user.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
seed = 1990
p <- 10
m<-rep(0,10)
sigma<-rep(0.1,10) 

W <- 1*upper.tri(matrix(0,p,p))

data <- dataCreate(nbData = 2*p, p = 10,KO = list(1,9), nbKO = c(p,p), W = W , m = m,sigma = sigma, seed = seed)$data

W1=1*upper.tri(matrix(0,p,p)) 
m1=rep(0,p)
s1=rep(10e-4,p)
colnames(W1)=names(m1)=names(s1)=rownames(W1)=paste("N",1:p,sep="")

GBnetwork = new("GBNetwork",WeightMatrix=W1,resMean=m1,resSigma=s1)

ord <- sample(1:p,10, replace = FALSE)
GBNOrder(GBnetwork,ord)

andreamrau/GBNcausal documentation built on May 12, 2019, 3:34 a.m.