attribute_assortativity_coefficient and numeric_assortativity_coefficient

176 views
Skip to first unread message

Merton

unread,
Jan 7, 2014, 6:09:56 PM1/7/14
to networkx...@googlegroups.com

Hello,

I have a question regarding the difference between attribute_assortativity_coefficient and numeric_assortativity_coefficient methods.

It seems to me that attribute_assortativity_coefficient is more generic, but is it strictly equivalent to numeric_assortativity_coefficient when the attribute contains positive integer values where such integers are intended to represent different categories/types?

One corner case I've noticed is that, if every node contains the same negative attribute value (e.g. -1), attribute_assortativity_coefficient gives 'NaN' whereas numeric_assortativity_coefficient gives a KeyError.

Some clarification would be much appreciated. Thanks!




Aric Hagberg

unread,
Jan 7, 2014, 7:48:16 PM1/7/14
to networkx...@googlegroups.com
If you are up for some good reading the best description is in
Newman's paper "Mixing patterns in networks"
http://arxiv.org/abs/cond-mat/0209450 10.1103/PhysRevE.67.026126

Attribute assortativity implements equation (2) and numeric
assortativity implements equation (21) (the later is the standard
Pearson correlation coefficient).

If all of the values (numeric or categorical) are the same then
neither of these metrics will return meaningful answers - they are
undefined/infinite/zero depending on how you feel about definitions
and dividing by zero. The error messages in that case are not very
clear as you pointed out. We could consider fixing that if it helps
make things clearer.

Aric
> --
> You received this message because you are subscribed to the Google Groups
> "networkx-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to networkx-discu...@googlegroups.com.
> To post to this group, send email to networkx...@googlegroups.com.
> Visit this group at http://groups.google.com/group/networkx-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages