Calculate nearest neighbor degree?

Computing metrics, community detection and data handling
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
emmalijohansson
Posts:6
Joined:08 Nov 2012 16:15
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Calculate nearest neighbor degree?

Post by emmalijohansson » 08 Nov 2012 16:35

I am pulling out some statistics from my network, but can't manage to figure out how to get the nearest neighbor degree, or average nearest neighbor degrees.

Anyone who knows? I'd be more than happy if!

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Calculate nearest neighbor degree?

Post by admin » 08 Nov 2012 17:24

What is this metric?

emmalijohansson
Posts:6
Joined:08 Nov 2012 16:15
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Calculate nearest neighbor degree?

Post by emmalijohansson » 09 Nov 2012 08:22

I have a network where the nodes represent countries and the edges represent the "trade of land", weighted in hectares.

It's a directed network and some nodes are both targets and investors (sources)
Ex.
Indonesia has a node degree of 10 as it has 7 investors, but are investing in 3 countries itself. I want to be able to calculate the average node degree of Indonesia's nearest neighbors, and get this statistic for all nodes as a separate column in the data lab. Is this possible?

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Calculate nearest neighbor degree?

Post by admin » 09 Nov 2012 10:32

It's not available, but you may code a metric plugin for it, or code some lines of python using Networkx.

Notice that the average is an unreliable statistic as it is very sensitive to outliers. You may better compute the median instead.

gmagerman
Posts:10
Joined:29 Sep 2012 15:24
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Calculate nearest neighbor degree?

Post by gmagerman » 15 Nov 2012 14:05

Hi,

Sebastien is right about the average especially when relating to power law distributions. However, the ANND or ANNS (avg nearest neighbor degree or -strength resp.) are used some times to estimate a degree of assortativity in the network: i.e. are higher degree nodes more likely to be connected to higher degree nodes.

Thank you for the code links, it might be good to estimate both & see the differences in real networks....

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable