Issues with using degree as a metric with correlation matricies

Degree summarizes the number of edges for each node in a graph

.. [1] JD Power, B Schlaggar, CN Lessov-Schlaggar, SE Petersen, "Evidence for Hubs in Human Functional Brain Networks" Neuron Volume 79, Issue 4, 21 August 2013, Pages 798–813 http://dx.doi.org/10.1016/j.neuron.2013.07.035


In [1]:
%matplotlib inline

In [2]:
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx

In [7]:
mat_100 = np.random.random((100,100))
mat_100[mat_100 < 0.7] = 0
mat_100 = np.triu(mat_100, k=1)
plt.imshow(mat_100, interpolation = 'nearest', vmin=0, vmax=1)
plt.colorbar()


Out[7]:
<matplotlib.colorbar.Colorbar instance at 0x3e81e60>

In [13]:
graph_100 = nx.from_numpy_matrix(mat_100)

degree_100 = graph_100.degree().values()

In [17]:
mat_500 = np.random.random((500,500))
mat_500[mat_500 < 0.7] = 0
mat_500 = np.triu(mat_500, k=1)
plt.imshow(mat_500, interpolation = 'nearest', vmin=0, vmax=1)
plt.colorbar()


Out[17]:
<matplotlib.colorbar.Colorbar instance at 0xb7c4f80>

In [18]:
graph_500 = nx.from_numpy_matrix(mat_500)

degree_500 = graph_500.degree().values()

In [23]:
plt.hist((degree_100, degree_500), bins=25 )


Out[23]:
([array([ 7, 51, 32, 10,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0]),
  array([  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   1,   9,  32,  66, 112, 111, 101,  46,  19,   3])],
 array([  17.  ,   23.56,   30.12,   36.68,   43.24,   49.8 ,   56.36,
         62.92,   69.48,   76.04,   82.6 ,   89.16,   95.72,  102.28,
        108.84,  115.4 ,  121.96,  128.52,  135.08,  141.64,  148.2 ,
        154.76,  161.32,  167.88,  174.44,  181.  ]),
 <a list of 2 Lists of Patches objects>)