User Tools

Site Tools


network_groups

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
network_groups [2015/12/01 09:14] hkimscilnetwork_groups [2015/12/02 14:31] (current) hkimscil
Line 1: Line 1:
 ====== Identifying groups of networks ====== ====== Identifying groups of networks ======
 +''setwd("D:/Users/Hyo/Cs-Kant/CS/Classes/sna_examples/sna_in_r")''
 +
 <code># Network's characteristics and subgroups <code># Network's characteristics and subgroups
 library(sna) library(sna)
Line 10: Line 12:
 gplot(fmh, vertex.cex=0.5, arrowhead.cex=0.5) gplot(fmh, vertex.cex=0.5, arrowhead.cex=0.5)
 </code> </code>
-{{fmh.png}}+{{fmh.png?400}}
  
 <code>round(gden(fmh),4) <code>round(gden(fmh),4)
Line 516: Line 518:
  
 {{fmh.clique.5members.png?300}} {{fmh.clique.5members.png?300}}
 +
 +
 +<code>s = matrix(0,5,5)
 +edge.list = matrix ( c(1,2,  1,3,  2,4,  2,5,  3,4,  3,5,  4,5,  5,4), byrow=T, ncol=2)
 +s[edge.list]=1
 +s
 +rownames(s)<-c("a", "b", "c", "d", "e")
 +colnames(s)<-c("a", "b", "c", "d", "e")
 +> s
 +</code>
 +<code>> s = matrix(0,5,5)
 +> edge.list = matrix ( c(1,2,  1,3,  2,4,  2,5,  3,4,  3,5,  4,5,  5,4), byrow=T, ncol=2)
 +> s[edge.list] = 1
 +> s
 +     [,1] [,2] [,3] [,4] [,5]
 +[1,]    0    1    1    0    0
 +[2,]    0    0    0    1    1
 +[3,]    0    0    0    1    1
 +[4,]    0    0    0    0    1
 +[5,]    0    0    0    1    0
 +</code>
 +
 +{{network_s.png?400}}
 +
 +눈으로 봐서 a를 중심으로 좌우동형이므로 b, c와 d,e는 각각 등치 (등가)라고 할 수 있다. 이를 수식으로 구하기 위한 접근 방법으로는 연결을 1, 비연결을 0으로 한 각 노드(점) 간의 거리를 구하여 거리가 가까운 것들을 모아 놓으면 될 것이다. 가장 흔한 예가 Hamming distance: 
 +  * see [[yt>P02mJhS9qQ4]]
 +
 +예:
 +
 +
 +<code>library(sna)
 +set.seed(123)
 +p1<-runif(10,0,1)
 +p2<-runif(10,0,1)
 +G1<-rgraph(10,tprob=sapply(p1,rep,10))
 +G2<-rgraph(10,tprob=t(sapply(p2,rep,10)))
 +G<-G1*G2
 +G
 +
 +hamming.G=sedist(G,method="hamming")
 +cluster <- equiv.clust(G, method="hamming", cluster.method="complete")
 +
 +
 +b.mdoel <- blockmodel(G, cluster, h=4.5)
 +b.model 
 +plot(b.model)
 +</code>
 +
 +{{cluster.dendrogram.png?400}}
 +
 +<code>> b.mdoel <- blockmodel(G, cluster, h=4.5)
 +> b.model 
 +
 +Network Blockmodel:
 +
 +Block membership:
 +
 +  2  3  4  5  6  7  8  9 10 
 +  2  1  3  4  1  1  3  4  5 
 +
 +Reduced form blockmodel:
 +
 +  
 +        Block 1 Block 2 Block 3 Block 4 Block 5
 +Block 1     0.0         0.875    0.25     0.5
 +Block 2     0.5     NaN   0.000    0.50     1.0
 +Block 3     0.0         0.500    0.25     0.5
 +Block 4     0.0         0.000    0.50     0.0
 +Block 5     0.0         1.000    1.00     NaN
 +> plot(b.model)
 +</code>
 +{{blockmodel.png?400}}
 +
network_groups.1448930685.txt.gz · Last modified: 2015/12/01 09:14 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki