>
> Hmmmm... In that case there is no variation in degree so I think
> the correlation is not defined. What is the Pearson correlation if the
> data doesn't vary? 1? 0?
I don't know, I am new to Networkx. The command syntax I am using is:
print "degree_assortativity_coefficient",'\t\t',
nx.degree_assortativity_coefficient(graphs[g])
where:
g = nx.Graph()
and rest of the graphs: tree, grid, linear returns a value and + and -
signs makes sense...
When I try the pearson coefficient:
print "degree_pearson_correlation_coefficient",'\t\t',
nx.degree_pearson_correlation_coefficient(graphs[g])
it gives error... I think pearson coefficient calculation looks for
directed graph input...
>
> Maybe it is best to leave it with the RuntimeWarning so people know
> there is an issue.
>
> Are you using this is a context where you wouldn't be able to tell
> ahead of time
> that the graphs are regular (same degree)? If so, you could check
> for the
> result being nan and set it to a meaningful value for your setting.
No, I know the graphs ahead of time. You can try a simple 3-node
complete graph (undirected and unweighted). a_ii 0, rest 1 in the
adjacency matrix...
IMHO, I think the value for a ring or a full mesh the value should be
1, making these types of networks perfectly assortative, since each
node is being connected to a same degree node.
Thanks,
Egemen
> Dan