# Understanding avg_neighbour_corr

Hi,

I'm trying to understand what is computed in graph_tool.correlations.
avg_neighbour_corr
but I couldn't figured out yet.

Take for example the minimal example below:

attachment.html (2.74 KB)

From the docs I'd expect h == np.mean(w) (which is the case) and h == np.std(w) (which is not the case).

As it is written in the documentation, the second value computed is the
standard deviation of the _mean_, not the standard deviation of the
_population_, which is what you are computing. The standard deviation of
the mean is: std(w) / sqrt(len(w))

In fact, I got to this issue trying to implement the analogous
function to graph_tool.correlations.avg_neighbour_corr but looking at

This is trivial, just compute the avg_neighbour_corr with the reversed
graph:

avg_neighbour_corr(GraphView(g, reversed=True), "in", "out")

Best,
Tiago

Hi,

> From the docs I'd expect h == np.mean(w) (which is the case) and
h == np.std(w) (which is not the case).

As it is written in the documentation, the second value computed is the
standard deviation of the _mean_, not the standard deviation of the
_population_, which is what you are computing. The standard deviation of
the mean is: std(w) / sqrt(len(w))

thanks! I missed that

> In fact, I got to this issue trying to implement the analogous
> function to graph_tool.correlations.avg_neighbour_corr but looking at