关于「似然比记账:两条阈值与复核区」,《族谱合龙与义庄永续》给出的定量结论是什么?
结论:第二章用费莱吉与森特之似然比与两条阈值,把误合从 36.33 对压到 0.612 对,代价是复核 15.4 对,并用期望最大化算法估参数。
数据口径:按字辈起名,同代人只剩一字可变,示意参数下一代 11 人就有一半机会撞名;两本 60 人对 40 人之支谱按全名硬接,接对者只占 0.208。 书中数据全为合成或示意,不含任何真实在世者资料;全部计算由书中程序生成;本书是非个人化分析,不构成法律、理财或经营建议,也不做任何血统高下或族群比较。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.612, 15.4, 36.33
| A. field weights in bits (illustrative m, u) | |
| field m u agree disagree | |
| given name | 0.95 0.0152 +5.97 -4.30 |
| birth year +-2 | 0.90 0.2500 +1.85 -2.91 |
| father name | 0.85 0.0152 +5.81 -2.71 |
| village | 0.80 0.2000 +2.00 -2.00 |
| spouse surname | 0.75 0.1000 +2.91 -1.85 |
| B. 32 patterns | 9 link, 9 review, 14 non-link |
| upper threshold +8.26 bits, lower threshold +0.50 bits | |
| P(link | non-match) mu | 0.000256 |
| P(non-link | match) lambda | 0.0147 |
| P(review | match) | 0.0820; P(review | non-match) = 0.0061 |
| C. expected counts for the 60 x 40 books of p12 | |
| false links 0.612, missed links 0.147, review pairs 15.4 | |
| name-only rule: false links 36.33, missed links 0.50 |
查看完整验算程序
# Chapter 2. p21: Fellegi-Sunter weights, two thresholds, error rates.
# Model (Fellegi and Sunter 1969): for each field k a pair agrees with
# probability m_k if it is a true match and u_k if it is not. Under
# conditional independence the log-likelihood ratio of a comparison
# pattern is the sum of field weights log2(m/u) on agreement and
# log2((1-m)/(1-u)) on disagreement. Sorting all 2^5 patterns by weight
# and cutting from the top until P(link | non-match) would exceed MU,
# and from the bottom until P(non-link | match) would exceed LAM, gives
# the upper and lower thresholds; patterns in between go to clerical
# review. m and u values are illustrative; u for names is the sum of
# p^2 from p11 (Zipf s = 0.8).
import math
from itertools import product
FIELDS = [("given name", 0.95, 0.0152), ("birth year +-2", 0.90, 0.25),
("father name", 0.85, 0.0152), ("village", 0.80, 0.20),
("spouse surname", 0.75, 0.10)]
MU, LAM = 0.0005, 0.02
NM, NU = 10, 2390 # the 60 x 40 books of p12
def patterns():
rows = []
for g in product((1, 0), repeat=len(FIELDS)):
pm, pu, wts = 1.0, 1.0, []
for a, (_, m, u) in zip(g, FIELDS):
pm *= m if a else 1.0 - m
pu *= u if a else 1.0 - u
wts.append(math.log2(m / u) if a else
math.log2((1.0 - m) / (1.0 - u)))
rows.append((math.fsum(wts), pm, pu, g))
rows.sort(key=lambda r: (-r[0], r[3]))
return rows
def thresholds(rows):
up, acc = 0, []
while up < len(rows) and math.fsum(acc + [rows[up][2]]) <= MU:
acc.append(rows[up][2])
up += 1
lo, acc = len(rows), []
while lo > up and math.fsum(acc + [rows[lo - 1][1]]) <= LAM:
acc.append(rows[lo - 1][1])
lo -= 1
return up, lo
if __name__ == "__main__":
print("A. field weights in bits (illustrative m, u)")
print(" field m u agree disagree")
for name, m, u in FIELDS:
print(" {:<15} {:.2f} {:.4f} {:>+6.2f} {:>+6.2f}".format(
name, m, u, math.log2(m / u),
math.log2((1.0 - m) / (1.0 - u))))
rows = patterns()
up, lo = thresholds(rows)
link, rev, non = rows[:up], rows[up:lo], rows[lo:]
def mass(rs, i):
return math.fsum(r[i] for r in rs)
print("B. 32 patterns: {} link, {} review, {} non-link".format(
len(link), len(rev), len(non)))
print(" upper threshold {:+.2f} bits, lower threshold {:+.2f} bits"
.format(link[-1][0], non[0][0]))
print(" P(link | non-match) mu = {:.6f}".format(mass(link, 2)))
print(" P(non-link | match) lambda = {:.4f}".format(mass(non, 1)))
print(" P(review | match) = {:.4f}; P(review | non-match) = {:.4f}"
.format(mass(rev, 1), mass(rev, 2)))
print("C. expected counts for the 60 x 40 books of p12")
print(" false links {:.3f}, missed links {:.3f}, review pairs {:.1f}"
.format(NU * mass(link, 2), NM * mass(non, 1),
NM * mass(rev, 1) + NU * mass(rev, 2)))
print(" name-only rule: false links {:.2f}, missed links {:.2f}"
.format(NU * FIELDS[0][2], NM * (1.0 - FIELDS[0][1])))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《宗族世系有向无环图合龙算法、字辈同余编码与范氏义庄跨代治理母典》第 2 章「似然比记账:两条阈值与复核区」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-334 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026334,
author = {Fan, Yafu},
title = {Genealogical DAG Merge Algorithms, Generation-Poem Congruence Coding and the Institutional Economics of the Fan Clan Charitable Estate},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}