# model on a block graph with three edge parameters
g<- graph(c(1,2,2,3, 3,1), directed=FALSE)
g<- set.vertex.attribute(g, "name", V(g), c("a", "b", "c")) # name the nodes
obj<- HRMBG(g)
obj<- setParams(obj, c(0.2,0.3, 0.1))
obj
# model on a tree with two edge parameters
g<- graph(c(1,2,2,3), directed=FALSE)
g<- set.vertex.attribute(g, "name", V(g), c("a" ,"b" ,"c")) # name the nodes
obj<- HRMtree(g)
obj<- setParams(obj, c(0.2,0.3))
obj
x<- c(0.2, 0.3)
names(x)<- names(obj$depParams)
obj<- setParams(obj, x)
obj
Run the code above in your browser using DataLab