5D Library › Dyadic Phase Coupling, Bilinear Compatibility Tensors and Spatiotemporal Grid Games · 中文
Chapter 8. A Four-Step Check and a Pre-Registered Test of Chart Matching
Four questions before believing a match
This chapter turns the book into four questions that can be put to any rule for matching charts, choosing dates or choosing directions — the author’s own software included. They are not advice on relationships or dates.
One: in which direction is the score? If the score matrix is not symmetric, “A suits B” and “B suits A” are two different numbers, and “best match” has two answers (Chapter 1). Ask which one the system reports, and whether the data behind it measured the two people separately — data with only a shared outcome cannot see one-sidedness.
Two: is the “danger window” an assumption or a finding? A model with noise alone makes no window; a window comes from an assumed fixed-date shock (Chapter 4). Ask whether the window rule was written down before the outcomes were seen, and how many separations with exact dates support it.
Three: where does the value of timing come from? In the nine-palace model, timing adds no value when the direction is free (Chapter 6). Ask whether the advice fixes both direction and time, and whether the door values put in are measurements or conventions.
Four: was the convention fixed in advance? The same data can be scored by many conventions. The program below shows what choosing the convention afterwards can produce on data with no effect at all.
Calculation
# Chapter 8. Twenty ways to score a match, and no real effect.
# 200 couples are followed for five years; each stays together with
# probability 0.75, independent of everything else (no effect exists).
# An analyst may score compatibility by 20 different conventions (house
# weights, which stars or trigrams count, which tensor entries...). The
# conventions are correlated with one another (each is 0.6 x a common part
# + 0.8 x its own part). For each, a two-sided test of the correlation
# between score and outcome at alpha = 0.05 (normal approximation,
# |r| sqrt(n) > 1.96). 5,000 simulated studies: how often at least one
# convention is "significant", and how often the best one keeps its sign
# and significance in a fresh sample of 200.
import math
import random
def corr(x, y):
n = len(x)
mx, my = sum(x) / n, sum(y) / n
sxy = sum((a - mx) * (b - my) for a, b in zip(x, y))
sxx = sum((a - mx) ** 2 for a in x)
syy = sum((b - my) ** 2 for b in y)
return sxy / math.sqrt(sxx * syy)
def study(rng, n=200, k=20):
common = [rng.gauss(0, 1) for _ in range(n)]
scores = [[0.6 * c + 0.8 * rng.gauss(0, 1) for c in common]
for _ in range(k)]
out = [1.0 if rng.random() < 0.75 else 0.0 for _ in range(n)]
rs = [corr(s, out) for s in scores]
return rs
if __name__ == "__main__":
rng = random.Random(62015)
n, studies, any_sig, rep = 200, 5000, 0, 0
for _ in range(studies):
rs = study(rng)
best = max(range(len(rs)), key=lambda i: abs(rs[i]))
if abs(rs[best]) * math.sqrt(n) > 1.96:
any_sig += 1
fresh = study(rng)[best]
if fresh * rs[best] > 0 and abs(fresh) * math.sqrt(n) > 1.96:
rep += 1
print(" one convention fixed in advance: false-positive rate 0.05")
print(" best of 20 chosen afterwards: false-positive rate"
" {:.3f}".format(any_sig / studies))
print(" of those 'findings', replicated in a fresh sample:"
" {:.3f}".format(rep / max(any_sig, 1)))
print("\nReading: with no effect at all, picking the best of twenty")
print("scoring conventions after seeing the data yields a 'significant'")
print("compatibility effect in about half of all studies, and almost")
print("none survives a fresh sample. Only a convention fixed before the")
print("data are seen can be tested.")
# one convention fixed in advance: false-positive rate 0.05
# best of 20 chosen afterwards: false-positive rate 0.517
# of those 'findings', replicated in a fresh sample: 0.024
#
# Reading: with no effect at all, picking the best of twenty
# scoring conventions after seeing the data yields a 'significant'
# compatibility effect in about half of all studies, and almost
# none survives a fresh sample. Only a convention fixed before the
# data are seen can be tested.Twenty correlated scoring conventions, not one real effect; picking the best afterwards yields a “significant” match effect in 0.517 of studies. Only 0.024 of these “findings” replicate in a fresh sample with the same direction and significance — no better than coincidence. Book 33 discussed this “garden of forking paths” in detail (Simmons et al. 2011; Gelman and Loken 2014); Book 37 cited Carlson’s double-blind test of astrology, in which astrologers matched charts no better than the chance rate of one in three (Carlson 1985).
A pre-registered test
The question the book raises — whether a match score is related to how relationships turn out — can be tested by an observational study written down in advance. The protocol below was written before any data exist.
Hypothesis · not established
Protocol. One scoring convention (the encoding , every entry of the matrix , and the code) is registered publicly before recruitment and not changed afterwards. Couples who have recently begun a relationship are recruited; at baseline both partners’ birth data are recorded and the score is computed by software, with neither the researchers nor the couples told the score. Couples are split at the median score into a high and a low half. Primary outcome: time to separation within five years, compared between the halves with a Cox model, two-sided . Secondary outcome: each partner’s own reported satisfaction, analysed with the actor-partner interdependence model, to estimate the antisymmetric part of Chapter 1. Decision: only a 95 % confidence interval for the hazard ratio that excludes 1, in the registered direction, counts as support; the size of the effect is reported in any case. An independent analyst with no financial relationship with the author, who does not know what the scores mean, runs the registered code, and the results are published whether positive or negative.
Calculation
# Chapter 8. Sizing a pre-registered test of a compatibility score.
# Design: one scoring convention, fixed and published before any data;
# couples split at the median score into a high and a low half; primary
# outcome the time to separation over five years, compared with a Cox
# model. Schoenfeld's formula gives the number of separations needed:
# d = (z_(1 - alpha/2) + z_power)^2 / (p (1 - p) ln(HR)^2), p = 0.5.
# Couples needed = d / (share separating within five years). Secondary
# outcome, from p02: EACH partner's own satisfaction, measured separately,
# so that a one-sided (antisymmetric) part can be estimated at all.
# The program also checks the formula by simulation for HR = 1.5:
# exponential times, 25 % five-year separation in the low half, 2,000
# simulated trials, a log-rank test at 0.05.
import math
import random
from statistics import NormalDist
Z = NormalDist()
def events_needed(hr, alpha=0.05, power=0.8):
z = Z.inv_cdf(1 - alpha / 2) + Z.inv_cdf(power)
return math.ceil(z * z / (0.25 * math.log(hr) ** 2))
def logrank(times, groups, horizon=5.0):
data = sorted(zip(times, groups))
at = [groups.count(0), groups.count(1)]
o1 = e1 = v = 0.0
for t, g in data:
if t > horizon:
break
n = at[0] + at[1]
e = at[1] / n
o1 += g
e1 += e
v += e * (1 - e)
at[g] -= 1
return (o1 - e1) / math.sqrt(v)
if __name__ == "__main__":
print(" hazard ratio separations needed couples (25 % separate)")
for hr in (1.2, 1.3, 1.5, 2.0):
d = events_needed(hr)
print(" {:3.1f} {:5d} {:6,d}".format(
hr, d, math.ceil(d / 0.25)))
rng = random.Random(62016)
hr, n_per = 1.5, math.ceil(events_needed(1.5) / 0.25 / 2)
lam0 = -math.log(0.75) / 5.0
hits = 0
for _ in range(2000):
times, groups = [], []
for g in (0, 1):
lam = lam0 * (hr if g else 1.0)
for _ in range(n_per):
times.append(rng.expovariate(lam))
groups.append(g)
if abs(logrank(times, groups)) > 1.96:
hits += 1
print("\n simulated power at HR 1.5 with {} couples per half:"
" {:.3f}".format(n_per, hits / 2000))
print("\nReading: even a large effect (hazard ratio 1.5) needs about")
print("190 separations and some 760 couples; a modest one needs several")
print("thousand. The simulation gives a little more than the planned")
print("80 %, because the high-risk half separates more often than 25 %")
print("and so supplies extra events.")
# hazard ratio separations needed couples (25 % separate)
# 1.2 945 3,780
# 1.3 457 1,828
# 1.5 191 764
# 2.0 66 264
#
# simulated power at HR 1.5 with 382 couples per half: 0.853
#
# Reading: even a large effect (hazard ratio 1.5) needs about
# 190 separations and some 760 couples; a modest one needs several
# thousand. The simulation gives a little more than the planned
# 80 %, because the high-risk half separates more often than 25 %
# and so supplies extra events.Schoenfeld’s formula gives the number of separations needed (Schoenfeld 1983): 66 at a hazard ratio of 2.0, 191 at 1.5, 457 at 1.3 and 945 at 1.2. If a quarter of couples part within five years, the corresponding numbers of couples are 264, 764, 1,828 and 3,780. The simulation gives power 0.853 at a hazard ratio of 1.5 with 382 couples per half, a little above the planned 80 %, because the high-risk half separates more often and supplies extra events.
Note
What the result would and would not mean. A negative result says that this one registered convention has no detectable effect in this population, and nothing about other conventions; a positive result shows an association, not a mechanism, and does not license using the score to decide anything for any particular two people. Whatever the result, re-analysing with another convention afterwards cannot be reported as the result of this test.
Summary
Four questions sum up the book: in which direction a score runs, and whether its data can see one-sidedness at all; whether a danger window is an assumption or something data revealed under a rule fixed in advance; whether the value of timing comes only from a fixed direction; and whether the scoring convention was fixed before the data were seen. Choosing among twenty conventions afterwards manufactures a “significant” effect in 0.517 of studies with no effect. A pre-registered test — one convention, blind scoring, time to separation over five years as the primary outcome, each partner’s satisfaction measured separately — needs about 190 separations for a large effect and thousands of couples for a moderate one.
References
Fan, Y. (2026). Dyadic Phase Coupling, Bilinear Compatibility Tensors and Spatiotemporal Grid Games: Asymmetric Kuramoto Locking, Stopping-Time Separation Hazards and Magic-Square Permutation Operators [双人相位耦合、双线性相容张量与时空网格博弈] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090172 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).