Learn R Programming

BANFF (version 1.1)

plot.Networks.Fast: Plotting Bayesian Network Discovery using a Hybrid Fast Algorithm

Description

plot method for class "Networks.Fast"

Usage

"plot"(x, ...)

Arguments

x
An object of class "Networks.Fast" resulting of a call to Networks.Fast.

...
other arguments

See Also

Networks.Fast.

Examples

Run this code
library(igraph)
####Gene Network discovery
##Generating Scale free Gene Network
library(igraph)
g <- barabasi.game(50, power=1, zero.appeal=1.5,directed = FALSE)
net=as(get.adjacency(g,attr=NULL),"matrix")
##Random assign selected genes and make the signal intension as gaussian mixture
newz=rep(c(1,0,0,1,0),10)
Simnorm=function(n){
weight = c(0.4, 0.6)
mu = c(8,6)
sigma = c(1,0.5)
z = sample(c(1,2),size=n, prob=weight,replace=TRUE)
r = rnorm(n,mean=mu[z],sd=sigma[z])
return(r)
}
testcov<-0
for(i in 1:50){
 if(newz[i]==0){
   testcov[i]<-rnorm(1,mean=0,sd=1)
 }else{
  testcov[i]<-Simnorm(1)
 }
}
pvalue=pnorm(-testcov)
total1=Networks.Fast(pvalue,net,iter=5,nburns=2,
v=20,algorithms="DPM",DPparallel=FALSE,
piall=c(0.8, 0.85, 0.9, 0.95),rhoall=c(1, 2, 5, 10, 15)
)

######Plotting the object of class "Networks.Fast"
plot(total1)

Run the code above in your browser using DataLab