|
The graph has 3 nodes with degrees:
- Node 1 (left): degree 1
- Node 2 (center): degree 2
- Node 3 (right): degree 1
There are 2 edges in the graph, both connecting a node of degree 1 to a node of degree 2.
Regarding Formula 2:
$r=\frac{S_1S_e-S_2^2}{S_1S_3-S_2^2}$
You have:
- $S_1 = \sum k_i = 1+2+1 = 4$
- $S_2 = \sum k_i^2 = 1^2+2^2+1^2 = 1+4+1 = 6$
- $S_3 = \sum k_i^3 = 1^3+2^3+1^3 = 1+8+1 = 10$
- $S_e$: This term often represents $2 \sum_{\text{edges}(u,v)} k_u k_v$. The edges are (node1, node2) and (node2, node3). So, $k_1k_2 = 1 \cdot 2 = 2$ and $k_2k_3 = 2 \cdot 1 = 2$. Thus, $\sum_{\text{edges}} k_u k_v = 2+2=4$. If $S_e = 2 \cdot 4 = 8$, your value is consistent with this definition.
Plugging these into your formula:
$r = \frac{4 \cdot 8 - 6^2}{4 \cdot 10 - 6^2} = \frac{32 - 36}{40 - 36} = \frac{-4}{4} = -1$
This calculation appears correct based on your intermediate values and a common definition for $S_e$. An assortativity of -1 indicates perfect disassortativity, which makes sense for this graph as low-degree nodes are exclusively connected to higher-degree nodes.
Regarding Formula 1:
$r=\frac{\sum_{j,k} jk(e_{jk}-q_jq_k)}{\sigma_q^2}$
You calculated:
- Numerator $\sum_{j,k} jk(e_{jk}-q_jq_k) = -1/4$
- Denominator $\sigma_q^2 = -1$
- Resulting $r = (-1/4) / (-1) = 1/4$
Here's where the issue lies:
The term $\sigma_q^2$ is the variance of the distribution $q_k$ (the distribution of degrees at the ends of a randomly chosen edge). A variance can never be negative. So, $\sigma_q^2 = -1$ is mathematically impossible and indicates an error in its calculation.
Let's recalculate $q_k$ and $\sigma_q^2$ for your graph:
- Degree distribution at edge ends ($q_k$):
The edges are (degree 1 node, degree 2 node) and (degree 2 node, degree 1 node).
The degrees at the "stubs" or ends of these edges are {1, 2, 1, 2}.
There are 4 such edge ends in total.
- $q_1$ (fraction of edge ends connected to a degree 1 node) = 2/4 = 1/2.
- $q_2$ (fraction of edge ends connected to a degree 2 node) = 2/4 = 1/2.
(All other $q_k=0$) - Calculate $\sigma_q^2$:
$\sigma_q^2 = \sum_k k^2 q_k - (\sum_k k q_k)^2$
- $\sum_k k q_k = (1 \cdot q_1) + (2 \cdot q_2) = (1 \cdot 1/2) + (2 \cdot 1/2) = 1/2 + 1 = 3/2$.
- $\sum_k k^2 q_k = (1^2 \cdot q_1) + (2^2 \cdot q_2) = (1 \cdot 1/2) + (4 \cdot 1/2) = 1/2 + 2 = 5/2$.
- $\sigma_q^2 = 5/2 - (3/2)^2 = 5/2 - 9/4 = 10/4 - 9/4 = 1/4$.
Now, let's re-calculate $r$ using Formula 1 with the correct $\sigma_q^2$:
The numerator $\sum_{j,k} jk(e_{jk}-q_jq_k)$ is indeed $-1/4$. This can be derived as $E[jk] - E[j]E[k]$ where $E[j]=E[k]=\sum_k k q_k = 3/2$, and $E[jk] = \sum_{edges} j_i k_i / M = (1\cdot2 + 2\cdot1)/2 = 2$. So, $2 - (3/2)(3/2) = 2 - 9/4 = -1/4$.
So, for Formula 1:
$r = \frac{-1/4}{1/4} = -1$.
|
|