-
Notifications
You must be signed in to change notification settings - Fork 138
/
function_reference.html
4992 lines (4861 loc) · 210 KB
/
function_reference.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Brain Connectivity Toolbox — bct 0.4 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="bct 0.4 documentation" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li><a href="index.html">bct 0.4 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="brain-connectivity-toolbox">
<h1>Brain Connectivity Toolbox<a class="headerlink" href="#brain-connectivity-toolbox" title="Permalink to this headline">¶</a></h1>
<div class="section" id="centrality">
<h2>Centrality<a class="headerlink" href="#centrality" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="bct.betweenness_bin">
<tt class="descclassname">bct.</tt><tt class="descname">betweenness_bin</tt><big>(</big><em>G</em><big>)</big><a class="headerlink" href="#bct.betweenness_bin" title="Permalink to this definition">¶</a></dt>
<dd><p>Node betweenness centrality is the fraction of all shortest paths in
the network that contain a given node. Nodes with high values of
betweenness centrality participate in a large number of shortest paths.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed/undirected connection matrix</p>
</div></blockquote>
<p><strong>BC</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>node betweenness centrality vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Betweenness centrality may be normalised to the range [0,1] as
BC/[(N-1)(N-2)], where N is the number of nodes in the network.</p>
</dd></dl>
<dl class="function">
<dt id="bct.betweenness_wei">
<tt class="descclassname">bct.</tt><tt class="descname">betweenness_wei</tt><big>(</big><em>G</em><big>)</big><a class="headerlink" href="#bct.betweenness_wei" title="Permalink to this definition">¶</a></dt>
<dd><p>Node betweenness centrality is the fraction of all shortest paths in
the network that contain a given node. Nodes with high values of
betweenness centrality participate in a large number of shortest paths.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>L</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>directed/undirected weighted connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>BC</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>node betweenness centrality vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<dl class="docutils">
<dt>The input matrix must be a connection-length matrix, typically</dt>
<dd>obtained via a mapping from weight to length. For instance, in a
weighted correlation network higher correlations are more naturally
interpreted as shorter distances and the input matrix should
consequently be some inverse of the connectivity matrix.</dd>
<dt>Betweenness centrality may be normalised to the range [0,1] as</dt>
<dd>BC/[(N-1)(N-2)], where N is the number of nodes in the network.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="bct.diversity_coef_sign">
<tt class="descclassname">bct.</tt><tt class="descname">diversity_coef_sign</tt><big>(</big><em>W</em>, <em>ci</em><big>)</big><a class="headerlink" href="#bct.diversity_coef_sign" title="Permalink to this definition">¶</a></dt>
<dd><p>The Shannon-entropy based diversity coefficient measures the diversity
of intermodular connections of individual nodes and ranges from 0 to 1.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>undirected connection matrix with positive and negative weights</p>
</div></blockquote>
<p><strong>ci</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>community affiliation vector</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>Hpos</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>diversity coefficient based on positive connections</p>
</div></blockquote>
<p><strong>Hneg</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>diversity coefficient based on negative connections</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.edge_betweenness_bin">
<tt class="descclassname">bct.</tt><tt class="descname">edge_betweenness_bin</tt><big>(</big><em>G</em><big>)</big><a class="headerlink" href="#bct.edge_betweenness_bin" title="Permalink to this definition">¶</a></dt>
<dd><p>Edge betweenness centrality is the fraction of all shortest paths in
the network that contain a given edge. Edges with high values of
betweenness centrality participate in a large number of shortest paths.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed/undirected connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>EBC</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>edge betweenness centrality matrix</p>
</div></blockquote>
<p><strong>BC</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>node betweenness centrality vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Betweenness centrality may be normalised to the range [0,1] as
BC/[(N-1)(N-2)], where N is the number of nodes in the network.</p>
</dd></dl>
<dl class="function">
<dt id="bct.edge_betweenness_wei">
<tt class="descclassname">bct.</tt><tt class="descname">edge_betweenness_wei</tt><big>(</big><em>G</em><big>)</big><a class="headerlink" href="#bct.edge_betweenness_wei" title="Permalink to this definition">¶</a></dt>
<dd><p>Edge betweenness centrality is the fraction of all shortest paths in
the network that contain a given edge. Edges with high values of
betweenness centrality participate in a large number of shortest paths.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>L</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>directed/undirected weighted connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>EBC</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>edge betweenness centrality matrix</p>
</div></blockquote>
<p><strong>BC</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>nodal betweenness centrality vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<dl class="docutils">
<dt>The input matrix must be a connection-length matrix, typically</dt>
<dd>obtained via a mapping from weight to length. For instance, in a
weighted correlation network higher correlations are more naturally
interpreted as shorter distances and the input matrix should
consequently be some inverse of the connectivity matrix.</dd>
<dt>Betweenness centrality may be normalised to the range [0,1] as</dt>
<dd>BC/[(N-1)(N-2)], where N is the number of nodes in the network.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="bct.eigenvector_centrality_und">
<tt class="descclassname">bct.</tt><tt class="descname">eigenvector_centrality_und</tt><big>(</big><em>CIJ</em><big>)</big><a class="headerlink" href="#bct.eigenvector_centrality_und" title="Permalink to this definition">¶</a></dt>
<dd><p>Eigenector centrality is a self-referential measure of centrality:
nodes have high eigenvector centrality if they connect to other nodes
that have high eigenvector centrality. The eigenvector centrality of
node i is equivalent to the ith element in the eigenvector
corresponding to the largest eigenvalue of the adjacency matrix.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary/weighted undirected adjacency matrix</p>
</div></blockquote>
<p><strong>v</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>eigenvector associated with the largest eigenvalue of the matrix</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.flow_coef_bd">
<tt class="descclassname">bct.</tt><tt class="descname">flow_coef_bd</tt><big>(</big><em>CIJ</em><big>)</big><a class="headerlink" href="#bct.flow_coef_bd" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the flow coefficient for each node and averaged over the
network, as described in Honey et al. (2007) PNAS. The flow coefficient
is similar to betweenness centrality, but works on a local
neighborhood. It is mathematically related to the clustering
coefficient (cc) at each node as, fc+cc <= 1.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>fc</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>flow coefficient for each node</p>
</div></blockquote>
<p><strong>FC</strong> : float</p>
<blockquote>
<div><p>average flow coefficient over the network</p>
</div></blockquote>
<p><strong>total_flo</strong> : int</p>
<blockquote class="last">
<div><p>number of paths that “flow” across the central node</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.kcoreness_centrality_bd">
<tt class="descclassname">bct.</tt><tt class="descname">kcoreness_centrality_bd</tt><big>(</big><em>CIJ</em><big>)</big><a class="headerlink" href="#bct.kcoreness_centrality_bd" title="Permalink to this definition">¶</a></dt>
<dd><p>The k-core is the largest subgraph comprising nodes of degree at least
k. The coreness of a node is k if the node belongs to the k-core but
not to the (k+1)-core. This function computes k-coreness of all nodes
for a given binary directed connection matrix.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>coreness</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>node coreness</p>
</div></blockquote>
<p><strong>kn</strong> : int</p>
<blockquote class="last">
<div><p>size of k-core</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.kcoreness_centrality_bu">
<tt class="descclassname">bct.</tt><tt class="descname">kcoreness_centrality_bu</tt><big>(</big><em>CIJ</em><big>)</big><a class="headerlink" href="#bct.kcoreness_centrality_bu" title="Permalink to this definition">¶</a></dt>
<dd><p>The k-core is the largest subgraph comprising nodes of degree at least
k. The coreness of a node is k if the node belongs to the k-core but
not to the (k+1)-core. This function computes the coreness of all nodes
for a given binary undirected connection matrix.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary undirected connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>coreness</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>node coreness</p>
</div></blockquote>
<p><strong>kn</strong> : int</p>
<blockquote class="last">
<div><p>size of k-core</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.module_degree_zscore">
<tt class="descclassname">bct.</tt><tt class="descname">module_degree_zscore</tt><big>(</big><em>W</em>, <em>ci</em>, <em>flag=0</em><big>)</big><a class="headerlink" href="#bct.module_degree_zscore" title="Permalink to this definition">¶</a></dt>
<dd><p>The within-module degree z-score is a within-module version of degree
centrality.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.narray</p>
<blockquote>
<div><p>binary/weighted directed/undirected connection matrix</p>
</div></blockquote>
<p><strong>ci</strong> : Nx1 np.array_like</p>
<blockquote>
<div><p>community affiliation vector</p>
</div></blockquote>
<p><strong>flag</strong> : int</p>
<blockquote>
<div><dl class="docutils">
<dt>Graph type. 0: undirected graph (default)</dt>
<dd><p class="first last">1: directed graph in degree
2: directed graph out degree
3: directed graph in and out degree</p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>Z</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>within-module degree Z-score</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.pagerank_centrality">
<tt class="descclassname">bct.</tt><tt class="descname">pagerank_centrality</tt><big>(</big><em>A</em>, <em>d</em>, <em>falff=None</em><big>)</big><a class="headerlink" href="#bct.pagerank_centrality" title="Permalink to this definition">¶</a></dt>
<dd><p>The PageRank centrality is a variant of eigenvector centrality. This
function computes the PageRank centrality of each vertex in a graph.</p>
<p>Formally, PageRank is defined as the stationary distribution achieved
by instantiating a Markov chain on a graph. The PageRank centrality of
a given vertex, then, is proportional to the number of steps (or amount
of time) spent at that vertex as a result of such a process.</p>
<p>The PageRank index gets modified by the addition of a damping factor,
d. In terms of a Markov chain, the damping factor specifies the
fraction of the time that a random walker will transition to one of its
current state’s neighbors. The remaining fraction of the time the
walker is restarted at a random vertex. A common value for the damping
factor is d = 0.85.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.narray</p>
<blockquote>
<div><p>adjacency matrix</p>
</div></blockquote>
<p><strong>d</strong> : float</p>
<blockquote>
<div><p>damping factor (see description)</p>
</div></blockquote>
<p><strong>falff</strong> : Nx1 np.ndarray | None</p>
<blockquote>
<div><p>Initial page rank probability, non-negative values. Default value is
None. If not specified, a naive bayesian prior is used.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>r</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>vectors of page rankings</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Note: The algorithm will work well for smaller matrices (number of
nodes around 1000 or less)</p>
</dd></dl>
<dl class="function">
<dt id="bct.participation_coef">
<tt class="descclassname">bct.</tt><tt class="descname">participation_coef</tt><big>(</big><em>W</em>, <em>ci</em>, <em>degree='undirected'</em><big>)</big><a class="headerlink" href="#bct.participation_coef" title="Permalink to this definition">¶</a></dt>
<dd><p>Participation coefficient is a measure of diversity of intermodular
connections of individual nodes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary/weighted directed/undirected connection matrix</p>
</div></blockquote>
<p><strong>ci</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>community affiliation vector</p>
</div></blockquote>
<p><strong>degree</strong> : str</p>
<blockquote>
<div><dl class="docutils">
<dt>Flag to describe nature of graph ‘undirected’: For undirected graphs</dt>
<dd><p class="first last">‘in’: Uses the in-degree
‘out’: Uses the out-degree</p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>P</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>participation coefficient</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.participation_coef_sign">
<tt class="descclassname">bct.</tt><tt class="descname">participation_coef_sign</tt><big>(</big><em>W</em>, <em>ci</em><big>)</big><a class="headerlink" href="#bct.participation_coef_sign" title="Permalink to this definition">¶</a></dt>
<dd><p>Participation coefficient is a measure of diversity of intermodular
connections of individual nodes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>undirected connection matrix with positive and negative weights</p>
</div></blockquote>
<p><strong>ci</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>community affiliation vector</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>Ppos</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>participation coefficient from positive weights</p>
</div></blockquote>
<p><strong>Pneg</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>participation coefficient from negative weights</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.subgraph_centrality">
<tt class="descclassname">bct.</tt><tt class="descname">subgraph_centrality</tt><big>(</big><em>CIJ</em><big>)</big><a class="headerlink" href="#bct.subgraph_centrality" title="Permalink to this definition">¶</a></dt>
<dd><p>The subgraph centrality of a node is a weighted sum of closed walks of
different lengths in the network starting and ending at the node. This
function returns a vector of subgraph centralities for each node of the
network.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary adjacency matrix</p>
</div></blockquote>
<p><strong>Cs</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>subgraph centrality</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="clustering">
<h2>Clustering<a class="headerlink" href="#clustering" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="bct.agreement">
<tt class="descclassname">bct.</tt><tt class="descname">agreement</tt><big>(</big><em>ci</em>, <em>buffsz=None</em><big>)</big><a class="headerlink" href="#bct.agreement" title="Permalink to this definition">¶</a></dt>
<dd><p>Takes as input a set of vertex partitions CI of
dimensions [vertex x partition]. Each column in CI contains the
assignments of each vertex to a class/community/module. This function
aggregates the partitions in CI into a square [vertex x vertex]
agreement matrix D, whose elements indicate the number of times any two
vertices were assigned to the same class.</p>
<p>In the case that the number of nodes and partitions in CI is large
(greater than ~1000 nodes or greater than ~1000 partitions), the script
can be made faster by computing D in pieces. The optional input BUFFSZ
determines the size of each piece. Trial and error has found that
BUFFSZ ~ 150 works well.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ci</strong> : NxM np.ndarray</p>
<blockquote>
<div><p>set of (possibly degenerate) partitions</p>
</div></blockquote>
<p><strong>buffsz</strong> : int | None</p>
<blockquote>
<div><p>sets buffer size. If not specified, defaults to 1000</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>D</strong> : NxN np.ndarray</p>
<blockquote class="last">
<div><p>agreement matrix</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.agreement_weighted">
<tt class="descclassname">bct.</tt><tt class="descname">agreement_weighted</tt><big>(</big><em>ci</em>, <em>wts</em><big>)</big><a class="headerlink" href="#bct.agreement_weighted" title="Permalink to this definition">¶</a></dt>
<dd><p>D = AGREEMENT_WEIGHTED(CI,WTS) is identical to AGREEMENT, with the
exception that each partitions contribution is weighted according to
the corresponding scalar value stored in the vector WTS. As an example,
suppose CI contained partitions obtained using some heuristic for
maximizing modularity. A possible choice for WTS might be the Q metric
(Newman’s modularity score). Such a choice would add more weight to
higher modularity partitions.</p>
<p>NOTE: Unlike AGREEMENT, this script does not have the input argument
BUFFSZ.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ci</strong> : NxM np.ndarray</p>
<blockquote>
<div><p>set of (possibly degenerate) partitions</p>
</div></blockquote>
<p><strong>wts</strong> : Mx1 np.ndarray</p>
<blockquote>
<div><p>relative weight of each partition</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>D</strong> : NxN np.ndarray</p>
<blockquote class="last">
<div><p>weighted agreement matrix</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.clustering_coef_bd">
<tt class="descclassname">bct.</tt><tt class="descname">clustering_coef_bd</tt><big>(</big><em>A</em><big>)</big><a class="headerlink" href="#bct.clustering_coef_bd" title="Permalink to this definition">¶</a></dt>
<dd><p>The clustering coefficient is the fraction of triangles around a node
(equiv. the fraction of nodes neighbors that are neighbors of each other).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>C</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>clustering coefficient vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Methodological note: In directed graphs, 3 nodes generate up to 8
triangles (2*2*2 edges). The number of existing triangles is the main
diagonal of S^3/2. The number of all (in or out) neighbour pairs is
K(K-1)/2. Each neighbour pair may generate two triangles. “False pairs”
are i<->j edge pairs (these do not generate triangles). The number of
false pairs is the main diagonal of A^2.
Thus the maximum possible number of triangles =</p>
<blockquote>
<div>= (2 edges)*([ALL PAIRS] - [FALSE PAIRS])
= 2 * (K(K-1)/2 - diag(A^2))
= K(K-1) - 2(diag(A^2))</div></blockquote>
</dd></dl>
<dl class="function">
<dt id="bct.clustering_coef_bu">
<tt class="descclassname">bct.</tt><tt class="descname">clustering_coef_bu</tt><big>(</big><em>G</em><big>)</big><a class="headerlink" href="#bct.clustering_coef_bu" title="Permalink to this definition">¶</a></dt>
<dd><p>The clustering coefficient is the fraction of triangles around a node
(equiv. the fraction of nodes neighbors that are neighbors of each other).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary undirected connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>C</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>clustering coefficient vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.clustering_coef_wd">
<tt class="descclassname">bct.</tt><tt class="descname">clustering_coef_wd</tt><big>(</big><em>W</em><big>)</big><a class="headerlink" href="#bct.clustering_coef_wd" title="Permalink to this definition">¶</a></dt>
<dd><p>The weighted clustering coefficient is the average “intensity” of
triangles around a node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>weighted directed connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>C</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>clustering coefficient vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Methodological note (also see clustering_coef_bd)
The weighted modification is as follows:
- The numerator: adjacency matrix is replaced with weights matrix ^ 1/3
- The denominator: no changes from the binary version</p>
<p>The above reduces to symmetric and/or binary versions of the clustering
coefficient for respective graphs.</p>
</dd></dl>
<dl class="function">
<dt id="bct.clustering_coef_wu">
<tt class="descclassname">bct.</tt><tt class="descname">clustering_coef_wu</tt><big>(</big><em>W</em><big>)</big><a class="headerlink" href="#bct.clustering_coef_wu" title="Permalink to this definition">¶</a></dt>
<dd><p>The weighted clustering coefficient is the average “intensity” of
triangles around a node.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>weighted undirected connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>C</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>clustering coefficient vector</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.consensus_und">
<tt class="descclassname">bct.</tt><tt class="descname">consensus_und</tt><big>(</big><em>D</em>, <em>tau</em>, <em>reps=1000</em><big>)</big><a class="headerlink" href="#bct.consensus_und" title="Permalink to this definition">¶</a></dt>
<dd><p>This algorithm seeks a consensus partition of the
agreement matrix D. The algorithm used here is almost identical to the
one introduced in Lancichinetti & Fortunato (2012): The agreement
matrix D is thresholded at a level TAU to remove an weak elements. The
resulting matrix is then partitions REPS number of times using the
Louvain algorithm (in principle, any clustering algorithm that can
handle weighted matrixes is a suitable alternative to the Louvain
algorithm and can be substituted in its place). This clustering
produces a set of partitions from which a new agreement is built. If
the partitions have not converged to a single representative partition,
the above process repeats itself, starting with the newly built
agreement matrix.</p>
<p>NOTE: In this implementation, the elements of the agreement matrix must
be converted into probabilities.</p>
<p>NOTE: This implementation is slightly different from the original
algorithm proposed by Lanchichinetti & Fortunato. In its original
version, if the thresholding produces singleton communities, those
nodes are reconnected to the network. Here, we leave any singleton
communities disconnected.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>D</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>agreement matrix with entries between 0 and 1 denoting the probability
of finding node i in the same cluster as node j</p>
</div></blockquote>
<p><strong>tau</strong> : float</p>
<blockquote>
<div><p>threshold which controls the resolution of the reclustering</p>
</div></blockquote>
<p><strong>reps</strong> : int</p>
<blockquote>
<div><p>number of times the clustering algorithm is reapplied. default value
is 1000.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>ciu</strong> : Nx1 np.ndarray</p>
<blockquote class="last">
<div><p>consensus partition</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.get_components">
<tt class="descclassname">bct.</tt><tt class="descname">get_components</tt><big>(</big><em>A</em>, <em>no_depend=False</em><big>)</big><a class="headerlink" href="#bct.get_components" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the components of an undirected graph specified by the binary and
undirected adjacency matrix adj. Components and their constitutent nodes
are assigned the same index and stored in the vector, comps. The vector,
comp_sizes, contains the number of nodes beloning to each component.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>adj</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary undirected adjacency matrix</p>
</div></blockquote>
<p><strong>no_depend</strong> : bool</p>
<blockquote>
<div><p>If true, doesn’t import networkx to do the calculation. Default value
is false.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>comps</strong> : Nx1 np.ndarray</p>
<blockquote>
<div><p>vector of component assignments for each node</p>
</div></blockquote>
<p><strong>comp_sizes</strong> : Mx1 np.ndarray</p>
<blockquote class="last">
<div><p>vector of component sizes</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Note: disconnected nodes will appear as components with a component
size of 1</p>
<p>Note: The identity of each component (i.e. its numerical value in the
result) is not guaranteed to be identical the value returned in BCT,
although the component topology is.</p>
<p>Note: networkx is used to do the computation efficiently. If networkx is
not available a breadth-first search that does not depend on networkx is
used instead, but this is less efficient. The corresponding BCT function
does the computation by computing the Dulmage-Mendelsohn decomposition. I
don’t know what a Dulmage-Mendelsohn decomposition is and there doesn’t
appear to be a python equivalent. If you think of a way to implement this
better, let me know.</p>
</dd></dl>
<dl class="function">
<dt id="bct.transitivity_bd">
<tt class="descclassname">bct.</tt><tt class="descname">transitivity_bd</tt><big>(</big><em>A</em><big>)</big><a class="headerlink" href="#bct.transitivity_bd" title="Permalink to this definition">¶</a></dt>
<dd><p>Transitivity is the ratio of ‘triangles to triplets’ in the network.
(A classical version of the clustering coefficient).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>T</strong> : float</p>
<blockquote class="last">
<div><p>transitivity scalar</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Methodological note: In directed graphs, 3 nodes generate up to 8
triangles (2*2*2 edges). The number of existing triangles is the main
diagonal of S^3/2. The number of all (in or out) neighbour pairs is
K(K-1)/2. Each neighbour pair may generate two triangles. “False pairs”
are i<->j edge pairs (these do not generate triangles). The number of
false pairs is the main diagonal of A^2. Thus the maximum possible
number of triangles = (2 edges)*([ALL PAIRS] - [FALSE PAIRS])</p>
<blockquote>
<div>= 2 * (K(K-1)/2 - diag(A^2))
= K(K-1) - 2(diag(A^2))</div></blockquote>
</dd></dl>
<dl class="function">
<dt id="bct.transitivity_bu">
<tt class="descclassname">bct.</tt><tt class="descname">transitivity_bu</tt><big>(</big><em>A</em><big>)</big><a class="headerlink" href="#bct.transitivity_bu" title="Permalink to this definition">¶</a></dt>
<dd><p>Transitivity is the ratio of ‘triangles to triplets’ in the network.
(A classical version of the clustering coefficient).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>A</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary undirected connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>T</strong> : float</p>
<blockquote class="last">
<div><p>transitivity scalar</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.transitivity_wd">
<tt class="descclassname">bct.</tt><tt class="descname">transitivity_wd</tt><big>(</big><em>W</em><big>)</big><a class="headerlink" href="#bct.transitivity_wd" title="Permalink to this definition">¶</a></dt>
<dd><p>Transitivity is the ratio of ‘triangles to triplets’ in the network.
(A classical version of the clustering coefficient).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>weighted directed connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>T</strong> : int</p>
<blockquote>
<div><p>transitivity scalar</p>
</div></blockquote>
<p><strong>Methodological note (also see note for clustering_coef_bd)</strong> :</p>
<p><strong>The weighted modification is as follows:</strong> :</p>
<p><strong>- The numerator: adjacency matrix is replaced with weights matrix ^ 1/3</strong> :</p>
<p><strong>- The denominator: no changes from the binary version</strong> :</p>
<p><strong>The above reduces to symmetric and/or binary versions of the clustering</strong> :</p>
<p class="last"><strong>coefficient for respective graphs.</strong> :</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bct.transitivity_wu">
<tt class="descclassname">bct.</tt><tt class="descname">transitivity_wu</tt><big>(</big><em>W</em><big>)</big><a class="headerlink" href="#bct.transitivity_wu" title="Permalink to this definition">¶</a></dt>
<dd><p>Transitivity is the ratio of ‘triangles to triplets’ in the network.
(A classical version of the clustering coefficient).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>W</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>weighted undirected connection matrix</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>T</strong> : int</p>
<blockquote class="last">
<div><p>transitivity scalar</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="core">
<h2>Core<a class="headerlink" href="#core" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="bct.assortativity_bin">
<tt class="descclassname">bct.</tt><tt class="descname">assortativity_bin</tt><big>(</big><em>CIJ</em>, <em>flag</em><big>)</big><a class="headerlink" href="#bct.assortativity_bin" title="Permalink to this definition">¶</a></dt>
<dd><p>The assortativity coefficient is a correlation coefficient between the
degrees of all nodes on two opposite ends of a link. A positive
assortativity coefficient indicates that nodes tend to link to other
nodes with the same or similar degree.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>binary directed/undirected connection matrix</p>
</div></blockquote>
<p><strong>flag</strong> : int</p>
<blockquote>
<div><p>0 : undirected graph; degree/degree correlation
1 : directed graph; out-degree/in-degree correlation
2 : directed graph; in-degree/out-degree correlation
3 : directed graph; out-degree/out-degree correlation
4 : directed graph; in-degree/in-degreen correlation</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>r</strong> : float</p>
<blockquote class="last">
<div><p>assortativity coefficient</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>The function accepts weighted networks, but all connection
weights are ignored. The main diagonal should be empty. For flag 1
the function computes the directed assortativity described in Rubinov
and Sporns (2010) NeuroImage.</p>
</dd></dl>
<dl class="function">
<dt id="bct.assortativity_wei">
<tt class="descclassname">bct.</tt><tt class="descname">assortativity_wei</tt><big>(</big><em>CIJ</em>, <em>flag</em><big>)</big><a class="headerlink" href="#bct.assortativity_wei" title="Permalink to this definition">¶</a></dt>
<dd><p>The assortativity coefficient is a correlation coefficient between the
strengths (weighted degrees) of all nodes on two opposite ends of a link.
A positive assortativity coefficient indicates that nodes tend to link to
other nodes with the same or similar strength.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>CIJ</strong> : NxN np.ndarray</p>
<blockquote>
<div><p>weighted directed/undirected connection matrix</p>
</div></blockquote>
<p><strong>flag</strong> : int</p>
<blockquote>
<div><p>0 : undirected graph; strength/strength correlation
1 : directed graph; out-strength/in-strength correlation
2 : directed graph; in-strength/out-strength correlation
3 : directed graph; out-strength/out-strength correlation