Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Conversation

@jpfairbanks
Copy link
Contributor

This PR is a duplicate of #274 covering issues #273 and #273.

We add functions for computing assortativity with respect to degree and categorical labels with nominal and local variations.

@jpfairbanks jpfairbanks added the enhancement new or improved functionality label Jan 14, 2016
@codecov-io
Copy link

Current coverage is 95.68%

Merging #275 into master will decrease coverage by -4.32% as of e7df389

Powered by Codecov. Updated on successful CI builds.

fixes to methods first assortativity to pass tests
formulas are wrong does not pass tests.
@sbromberger
Copy link
Owner

Is the plan to fix the tests?

http://arxiv.org/abs/cond-mat/0209450
"""
function assortativity_coefficient(g::DiGraph, sjk, ssj, sk, sjs, sks, nue)
return res = (sjk - sj*sk/nue)/sqrt((sjs - sj^2/nue)*(sks - sk^2/nue))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These parameters need types.

@jpfairbanks
Copy link
Contributor Author

We shouldn't merge it until the math errors are resolved. @akarpf have you resolved the math errors?

@sbromberger
Copy link
Owner

It needs a more in-depth review as well... I've just skimmed so far.

@ghost
Copy link

ghost commented Mar 7, 2016

@sbromberger Sorry, I was extremely busy recently as I am currently commuting between two different cities. @jpfairbanks Can you hint me to the maths errors? I was actually double-checking it with the igraph functions. Trying to do all that on the weekend.

@jpfairbanks
Copy link
Contributor Author

If you look at this file, https://github.com/JuliaGraphs/LightGraphs.jl/blob/assortativity/test/centrality/assortativity.jl

it tests that if you look at the path graph on n vertices, the assortativity should be increasing in n.
Also the assortativity of a complete graph should be positive since all vertices have the same degree. If these are not true properties of assortativity, let me know. These are intuitive properties to me, but I didn't prove them from the definition.

Can create a list of graphs that you can test with both igraph and LightGraphs?
If you run the igraph function on them and get the values, we can include those values in the tests.

@ghost
Copy link

ghost commented Mar 15, 2016

@jpfairbanks In the graph version of the assortativity measure a value of >0 points to assortative mixing (+1 perfect assortativity), while a value < 0 points to disassortative mixing (-1 perfect disassortativty). Of the 0 the graph is non-assortative. The individual level scores are not constrained to be inside [-1,1] but should in sum yield the graph wide measure.
This is the check I made, having compared the results for graph level assortativity with those from igraph before.

@jpfairbanks
Copy link
Contributor Author

Where is the code that checks against the values produced by igraph? That code should be the basis of the necessary unit tests.

@ghost
Copy link

ghost commented Mar 15, 2016

@jpfairbanks Clear, this is what I going to deliver as soon as I find the time. However, once can check for the consistence of the code by summing up the node level assortativity values of an arbitrary graph. This sum should correspond to the graph level result. If not, then I uploaded the wrong code. I am going to check this.

@sbromberger
Copy link
Owner

Hi,

What's the plan for this PR?

@jpfairbanks
Copy link
Contributor Author

Hey @akarpf, did you find the time to fix things?

@ghost
Copy link

ghost commented Apr 28, 2016

@akarpf I more or less fixed it, I however asked you a question with regard to example networks (florentine marriage network etc.) with which I/we can benchmark other libraries like igraph around three weeks ago.

@jpfairbanks
Copy link
Contributor Author

Oh I don't remember that. What was the question? There are example networks in generators.jl and datasets.jl. Generators are graphs that are parameterized usually by a size. and datasets are examples found in the literature.

@sbromberger
Copy link
Owner

@jpfairbanks @akarpf - what's the status of this PR?

@sbromberger
Copy link
Owner

@akarpf @jpfairbanks we're coming up on 8 months since the PR was originally opened, and 4 months since the last substantive comment. What's the plan?

@sbromberger
Copy link
Owner

Closing out due to inactivity. @jpfairbanks - feel free to reopen if you want to keep working on it.

@sbromberger sbromberger closed this Sep 4, 2016
@sbromberger sbromberger deleted the assortativity branch September 17, 2017 02:38
@heliosdrm heliosdrm mentioned this pull request Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement new or improved functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants