Discussion:
[igraph] Assortativity value NaN for regular networks
Borja Esteve-Altava
2018-04-02 08:36:55 UTC
Permalink
Hi everyone,

I want to use the assortativity degree as a ways of estimating the level of
homogeneity / heterogeneity of real networks:
1 = homogeneous (all vertices having degree k, they all connect to vertices
with degree k)
-1 = heterogeneous
assortativity_degree(make_star(25, mode = "undirected"), directed=FALSE)
[1] -1

However, for the other extreme of homogeneity (e.g., regular networks) the
function assortativity_degree() does not return a value of 1, but a NaN.
assortativity_degree(make_lattice(c(1, 5, 5), circular=T), directed=FALSE)
[1] NaN

When I tried to do an "almost-regular" network by deleting one edge in the
regular, instead of getting a close to 1 value I got a close to 0 value.
assortativity_degree(make_lattice(c(1, 5, 5), circular = T) %>%
delete_edges(1), directed=F)
[1] -0.06521739

Any clue why regular networks do not show values of 1?
Am I missing something about how assortativity is calculated?

Thanks a lot!
--
*Borja*
Szabolcs Horvát
2018-04-02 09:47:10 UTC
Permalink
Hello Borja,

If you go back to the mathematical definition of assortativity, it makes
perfect sense. It is a normalized correlation. If all degrees are the
same, then the correlation is 0, and so is the variance, 0/0 -> NaN. If
the degrees are *almost* the same, then the correlation is almost zero, the
variance is nonzero, verysmall / nonzero -> verysmall.

Intuitively, your regular network is not special among networks with the
same degrees: the vertices have no choice but to connect to other vertices
of the same degree. Compare with networks with a wide range of degrees
present: some of these are assortative, some aren't. Unlike in the case of
regular graphs, there's a freedom.
Post by Borja Esteve-Altava
Hi everyone,
I want to use the assortativity degree as a ways of estimating the level
1 = homogeneous (all vertices having degree k, they all connect to
vertices with degree k)
-1 = heterogeneous
assortativity_degree(make_star(25, mode = "undirected"), directed=FALSE)
[1] -1
However, for the other extreme of homogeneity (e.g., regular networks) the
function assortativity_degree() does not return a value of 1, but a NaN.
assortativity_degree(make_lattice(c(1, 5, 5), circular=T),
directed=FALSE)
[1] NaN
When I tried to do an "almost-regular" network by deleting one edge in the
regular, instead of getting a close to 1 value I got a close to 0 value.
assortativity_degree(make_lattice(c(1, 5, 5), circular = T) %>%
delete_edges(1), directed=F)
[1] -0.06521739
Any clue why regular networks do not show values of 1?
Am I missing something about how assortativity is calculated?
Thanks a lot!
--
*Borja*
_______________________________________________
igraph-help mailing list
https://lists.nongnu.org/mailman/listinfo/igraph-help
Loading...