igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Computing assortativity via degree correlation


From: Alexander Semenov
Subject: Re: [igraph] Computing assortativity via degree correlation
Date: Sat, 7 Feb 2015 22:46:32 +0300

Hi, Massimo.

Your code returns identical results to assortativity.degree(), so, I guess you might consider switching to that function like I did.

Best,
Alex.

(Social | Network | Data) Analyst

Junior Research Fellow at the International Laboratory of Applied Network Research
National Research University Higher School of Economics

2015-01-29 20:22 GMT+03:00 Massimo Franceschet <address@hidden>:
> I've tried 3 different versions of code to calculate assortativity via
> degree correlation and two of them returned NA, while the third gave some
> reasonable numbers. My quistion is: can I trust it and why could 2 other
> receipts fail?

I use this:

# g is a graph
d = degree(g)
e = get.edgelist(g)
x = c(e[,1], e[,2])
y = c(e[,2], e[,1])
dx = d[x]
dy = d[y]
cor(dx, dy)

This corresponds to equation (7.82) page 230 of Mark Newman's book (Networks).

Best,

Massimo Franceschet
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]