# Scalar Assortativity - Definition

Hello Tiago,

I have a quick question about how the scalar assortativity is calculated.
You reference "M. E. J. Newman, “Mixing patterns in networks”, Phys. Rev. E
67, 026126 (2003)" as source for the equation. In the paper the equation
seems to consider edges connecting nodes of indegree x to those of outdegree
y (or rather "j" and "k"). In your implementation I am able to choose
in-degree, out-degree or total as degree type. What does this do to the
equation? If I choose, say, "in", will that mean the algorithm will look at
edges connecting nodes of indegree x to those of indegree y? If so, is there
a way for me to find the assortativity as per the definition in the paper?

Best,

Philipp

Hi,

Could I follow up on this again for clarification? I have also come across
this paper "Assortative mixing in directed biological networks", M.
Piraveenan et al., DOI: 10.1109/TCBB.2010.80 which describes an
assortativity coefficient which would perhaps match the description in the
manual.

Any clarification would be much appreciated!

Best,

Philipp

Hi Tiago,

I am sorry to keep bringing this up but could you help me with the

Best,

Philipp

If I choose, say, "in", will that mean the algorithm will look at
edges connecting nodes of indegree x to those of indegree y?

Yes.

If so, is there
a way for me to find the assortativity as per the definition in the paper?

You can write your own loop... It is pretty simple.

But if you want the function to be generalized, open an issue in the
website, and I will address it when I find the time.

Hi Tiago,

I am quite happy with the current implementation though can file a feature
request if you would like me to. What I am mostly after is the definition of
the actual equation used so I can cite it as the paper cited in the manual
doesn't contain the equation that seems to be used as far as I can tell.
Hence my question if it comes from dx.doi.org/10.1109/TCBB.2010.80 which
seems to use an equation that does what you are describing.

Best,

Philipp

The documentation describes _exactly_ the equation that is being used:

https://graph-tool.skewed.de/static/doc/correlations.html#graph_tool.correlations.scalar_assortativity