Forgot password?
 Register account
View 4867|Reply 4

[组合] 同配系数

[Copy link]

83

Threads

434

Posts

5419

Credits

Credits
5419

Show all posts

tommywong Posted 2014-3-28 14:31 |Read mode
Last edited by hbghlyj 2025-5-25 21:05$r=\frac{\sum_{j,k} jk(e_{jk}-q_jq_k)}{\sigma_q^2}$

$r=\frac{S_1S_e-S_2^2}{S_1S_3-S_2^2}$

书上说这两个是等价的,但我试过几个图,都得出了两个不同的值。就以这个为例:


$r=\frac{\sum_{j,k} jk(e_{jk}-q_jq_k)}{\sigma_q^2}=\frac{(\frac{-1}{4})}{-1}=\frac{1}{4}$

$r=\frac{S_1S_e-S_2^2}{S_1S_3-S_2^2}=\frac{4(8)-6^2}{4(10)-6^2}=-1$

我算错了吗?
现充已死,エロ当立。
维基用户页:https://zh.wikipedia.org/wiki/User:Tttfffkkk
Notable algebra methods:https://artofproblemsolving.com/community/c728438
《方幂和及其推广和式》 数学学习与研究2016.

83

Threads

434

Posts

5419

Credits

Credits
5419

Show all posts

 Author| tommywong Posted 2014-5-2 15:23
已发现问题出自教材公式笔误,感谢各位关注

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

Show all posts

hbghlyj Posted 2025-5-25 20:12
zh.wikipedia.org/zh-cn/同配性#同配系数
Yes, you made a calculation error in Formula 1, specifically in determining $\sigma_q^2$.
  • Your calculation for Formula 2 resulting in $r = -1$ is correct.
  • Your numerator for Formula 1, $\sum_{j,k} jk(e_{jk}-q_jq_k) = -1/4$, is correct.
  • Your value for $\sigma_q^2 = -1$ was incorrect. The correct value is $\sigma_q^2 = 1/4$.
  • Using the correct $\sigma_q^2$, Formula 1 also yields $r = -1$.

The book is correct: the two formulas are equivalent, and for your example graph, the assortativity coefficient is -1. This means the graph is perfectly disassortative.

3153

Threads

7906

Posts

610K

Credits

Credits
64096
QQ

Show all posts

hbghlyj Posted 2025-5-25 20:14
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$.

83

Threads

434

Posts

5419

Credits

Credits
5419

Show all posts

 Author| tommywong Posted 2025-5-27 09:00
hbghlyj 發表於 2025-5-25 20:12
https://zh.wikipedia.org/zh-cn/同配性#同配系数
Yes, you made a calculation error in Formula 1, speci ...
我記得就是$\sigma_q^2=\sum_k k^2q_k-(\sum_k kq_k)^2$這個公式出錯
教材上寫的是$\sigma_q^2=\sum_k k^2q_k^2-(\sum_k kq_k)^2$
所以我做作業時得到了$\displaystyle \sigma_q^2=\frac{1}{4}+\frac{4}{4}-(\frac{1}{2}+\frac{2}{2})^2=-1$
老師也不知道兩個公式得到了不同結果的原因
後來我回顧教材上的指示,嘗試把$e_{jk}=q_k\delta_{jk}$代入$\sum_{j,k} jk(e_{jk}-q_jq_k)$時終於發現了這個錯誤
同配性這個條目就是我在2014年5月2日寫的
现充已死,エロ当立。
维基用户页:https://zh.wikipedia.org/wiki/User:Tttfffkkk
Notable algebra methods:https://artofproblemsolving.com/community/c728438
《方幂和及其推广和式》 数学学习与研究2016.

Mobile version|Discuz Math Forum

2025-6-5 01:37 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit