On 04.10.2017 13:27, Snehal Shekatkar wrote:
>
> I am using gt.scalar_assortativity and I observed that it returns non-zero
> values and big variance values even when the values on the nodes are exactly
> same.
>
> g = gt.collection.data['karate']
> s = g.new_vertex_property('float')
> for v in g.vertices():
> s[v] = 0.9999
> gt.scalar_assortativity(g, deg = s)
>
> This returns : (1.0, 8.889098493616578)
>
> I expect to see (0, 0) here. What am I missing?
>
The scalar assortativity coefficient is undefined if the variance is zero,
since it appears in the denominator.
The expectation that it will be zero in this case is incorrect, since the
limit where the variance goes to zero is also undefined in general.
The proper answer in this case would be to return "NaN". I'll modify the
code in this way.
Best,
Tiago
--
Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool