5D Library › 关系断裂生存分析、断联期记忆衰减与复联博弈窗口 · English
第一章 把复合当作生存分析问题
两个事件互相竞争
分手之后,一对前任可能发生两件事:复合,或者一方、双方另有新生活,例如进入新的关系。一旦有人另有新生活,复合就不再是原来的问题。关于分分合合恋爱关系的研究发现复合相当常见,并不罕见 (Dailey et al. 2009);这里的问题是怎样计数。生存分析是自然的工具,但两个事件互相竞争时必须小心使用。
p01 跟踪一个合成队列:2,000 对前任,跟踪一年。十分之三的伴侣态度摇摆,如果没有别的事发生就会很快复合;其余的已经心意已定。每一对伴侣另有新生活的机会都一样。
推导
# Chapter 1. p01: Who gets back together, and how to count it. A
# synthetic cohort of 2,000 former couples is followed for 365 days.
# Two events compete: reconciliation, and "moving on" (a new partner,
# after which reconciliation is treated as no longer possible). 30% of
# couples are ambivalent (reconciliation hazard 1/60 a day); the rest
# are settled (1/1500 a day). Moving on has hazard 1/200 a day for all.
# Kaplan-Meier treats moving on as censoring and so overstates the
# chance of reconciliation; the cumulative incidence does not. Seed 92.
import random
N, DAYS, P_AMB, H_AMB, H_SET, H_MOVE = 2000, 365, 0.30, 1 / 60, \
1 / 1500, 1 / 200
def cohort(rng):
out = []
for _ in range(N):
h = H_AMB if rng.random() < P_AMB else H_SET
tr, tm = rng.expovariate(h), rng.expovariate(H_MOVE)
if min(tr, tm) > DAYS:
out.append((DAYS, "censored"))
elif tr < tm:
out.append((tr, "reconciled"))
else:
out.append((tm, "moved on"))
return out
def km_and_ci(data, t_end):
data = sorted(data)
at_risk, s_km, s_all, ci = len(data), 1.0, 1.0, 0.0
for t, kind in data:
if t > t_end:
break
if kind == "reconciled":
ci += s_all / at_risk # Aalen-Johansen increment
s_km *= 1 - 1 / at_risk # KM: moving on as censoring
if kind != "censored":
s_all *= 1 - 1 / at_risk # survival from either event
at_risk -= 1
return 1 - s_km, ci
if __name__ == "__main__":
rng = random.Random(92)
data = cohort(rng)
print(" by day Kaplan-Meier cumulative incidence observed share")
for t in (30, 90, 180, 365):
km, ci = km_and_ci(data, t)
obs = sum(1 for d, k in data if k == "reconciled" and d <= t) / N
print(" {:6d} {:12.3f} {:20.3f} {:14.3f}".format(
t, km, ci, obs))
rec = [d for d, k in data if k == "reconciled"]
print(" reconciliations in the first 90 days: {:.3f} of all".format(
sum(1 for d in rec if d <= 90) / len(rec)))
print(" couples who moved on within the year: {:.3f}".format(
sum(1 for d, k in data if k == "moved on") / N))
# by day Kaplan-Meier cumulative incidence observed share
# 30 0.137 0.128 0.128
# 90 0.286 0.241 0.240
# 180 0.379 0.290 0.289
# 365 0.456 0.311 0.310
# reconciliations in the first 90 days: 0.775 of all
# couples who moved on within the year: 0.597常用的 Kaplan-Meier 估计 (Kaplan and Meier 1958) 把另有新生活的伴侣当作「删失」,好像他们以后仍可能复合。它报告第 30 天 0.137、第 90 天 0.286、年底 0.456。但真正复合的比例只有 0.128、0.240 与 0.310。累积发生率 (Aalen and Johansen 1978) 把另有新生活当作使这对伴侣退出问题的事件,得到 0.128、0.241、0.290 与 0.311,与实际情况相符。差距随时间扩大,因为一年内有 0.597 的伴侣另有了新生活。
同一个队列也说明「复合大多发生在早期」为什么既对又容易误导:全部复合中有 0.775 发生在前 90 天。这说的是谁会复合(主要是态度摇摆、很快复合的那些),而不是对任何一个具体的人保证等待没有用。
窗口会关闭吗?
第二个流行的说法是复合的机会在几个月后就会「关闭」。p02 构造一个不可能关闭的世界:每一对伴侣在整整一年里每天复合的机会都不变,只是彼此大小不同。
推导
# Chapter 1. p02: Does the "window" close, or do the likely couples
# simply leave first? Every couple keeps a constant daily hazard of
# reconciling for the whole year (no couple's chance ever declines),
# but couples differ: hazards are drawn from a gamma law with mean
# 1/250 a day and shape k. The hazard seen in the surviving group still
# falls month by month, because the couples most likely to reconcile
# leave the group first. For k = 0.5 the decline is steep. Seed 92.
import random
def life_table(rng, k, n=20000, days=360):
hs = [rng.gammavariate(k, (1 / 250) / k) for _ in range(n)]
ts = [rng.expovariate(h) for h in hs]
rows = []
for a in range(0, days, 60):
risk = [t for t in ts if t >= a]
ev = sum(1 for t in risk if t < a + 60)
rows.append((a, ev / len(risk) / 60 * 1000))
return rows
if __name__ == "__main__":
rng = random.Random(92)
print(" observed hazard per 1,000 couples per day, by window")
print(" window (days) all alike shape 2.0 shape 0.5")
tabs = [life_table(rng, k) for k in (1e6, 2.0, 0.5)]
for i in range(6):
a = tabs[0][i][0]
print(" {:3d} to {:3d} {:9.2f} {:9.2f} {:9.2f}".format(
a, a + 59, tabs[0][i][1], tabs[1][i][1], tabs[2][i][1]))
f = tabs[2][-1][1] / tabs[2][0][1]
print(" shape 0.5: last window / first window = {:.3f}".format(f))
# observed hazard per 1,000 couples per day, by window
# window (days) all alike shape 2.0 shape 0.5
# 0 to 59 3.62 3.38 2.96
# 60 to 119 3.56 3.11 2.14
# 120 to 179 3.57 2.83 1.77
# 180 to 239 3.55 2.65 1.40
# 240 to 299 3.55 2.48 1.19
# 300 to 359 3.58 2.17 1.05
# shape 0.5: last window / first window = 0.355所有伴侣都一样时,每个时间段观察到的风险率都在每天每 1,000 对 3.55 至 3.62 之间。伴侣彼此不同时,群体中看到的风险率仍然逐月下降:在差异很大的人群里(形状参数 0.5)从 2.96 开始,降到 1.05,最后一段只有第一段的 0.355。没有任何一对伴侣自己的机会改变过。最可能复合的伴侣先复合、先离开样本,于是仍然分开的伴侣平均而言是较不可能复合的那些。图上一条下降的曲线,因此不能证明时间本身会关上窗口;它可能只是显示了谁留了下来。
假说 · 尚未验证
作者的诠释(尚未验证): 分手后几个月里复合率的下降,大部分反映的是伴侣之间的差异,而不是每一对伴侣自身机会的下降。什么会证明它错: 在一个对每对伴侣反复测量双方联系与复合意愿的队列中,把这些测量固定之后,伴侣自身的复合机会仍随时间下降,下降幅度与群体风险率的下降相当。
小结
计算复合必须把另有新生活当作竞争事件,否则会高估复合的机会;在 p01 里,到年底高估的部分几乎是真实比例的一半。随时间下降的风险率可以完全来自筛选。读到「有多少伴侣复合」的统计并拿来套用在自己身上时,这两点都很重要。
参考文献
Fan, Y. (2026). Relationship Rupture Survival Analysis, No-Contact Memory Decay and Reconciliation Game Windows: Negative-Affect Dissipation Rates, Dual-Process Nostalgia Peaks and Signaling Equilibria [关系断裂生存分析、断联期记忆衰减与复联博弈窗口] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090241 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).