5D Library › 四柱排盘的历法计算与规则引擎 · English

第八章 四步核查、一致性研究与一项预注册的配对检验

相信一个排盘软件之前的四个问题

本章把全书变成四个问题,可以向任何四柱排盘软件——包括作者自己的——提出。它们不是决策建议。

一、它用的是哪一套历法约定? 钟表时间还是真太阳时,子时怎样换日,节气时刻从哪里来(第二、三章)。软件应当写明,并公开第六章那样的测试向量与指纹。

二、它怎样处理出生时间的不确定? 一刻钟的误差就让十分之一左右的人时柱有误(第三章)。软件应当询问出生时间的可靠程度,并在报告时间落入边界提示区时给出相邻时辰的盘。

三、它的判断用的是哪一组参数? 藏干怎样计权,阈值是多少,从格怎样判定(第四、五章)。软件应当公开参数,并报告换一组说得通的参数后判定的变化。

四、它说中的是谁? 第 63 本与第 65 本讨论过:被认为准确不等于区分了人。要衡量一份解读是否属于它的主人,需要盲法的配对检验 (Carlson 1985)。

一致性研究:先量引擎之间的分歧

在问「身强的人是否如何如何」之前,应当先问一个更基本、也更便宜的问题:不同的引擎或不同的实践者,对同一张盘的旺衰判断有多一致?这是可重复性的检验,而不是有效性的检验。

推导

# Chapter 8. How many charts a concordance study needs.
# A concordance study gives the same charts, blind, to several engines
# or practitioners and measures agreement with Cohen's kappa. It tests
# reproducibility, not validity. With observed agreement p_o and chance
# agreement p_e, the large-sample standard error of kappa is about
#   se = sqrt(p_o (1 - p_o) / n) / (1 - p_e),
# so the n needed for a 95 % interval of half-width h follows. The
# planning values come from conventions A and B of p10.
import math

PO, KAPPA = 0.768, 0.553                  # A vs B in p10
PE = (PO - KAPPA) / (1 - KAPPA)

def n_for(h, po=PO, pe=PE, z=1.959964):
    return math.ceil(z * z * po * (1 - po) / ((1 - pe) ** 2 * h * h))

if __name__ == "__main__":
    print("   planning values: p_o {:.3f}, kappa {:.3f}, p_e {:.3f}".format(
        PO, KAPPA, PE))
    for h in (0.10, 0.05, 0.025):
        print("   half-width {:.3f}: {:,d} charts".format(h, n_for(h)))
    print("\nReading: a few hundred charts pin kappa down to within 0.1,")
    print("about a thousand to within 0.05. Agreement between engines can")
    print("be measured cheaply and should be published before any claim")
    print("about what a strong or weak chart means.")
#    planning values: p_o 0.768, kappa 0.553, p_e 0.481
#    half-width 0.100: 255 charts
#    half-width 0.050: 1,017 charts
#    half-width 0.025: 4,066 charts
#
# Reading: a few hundred charts pin kappa down to within 0.1,
# about a thousand to within 0.05. Agreement between engines can
# be measured cheaply and should be published before any claim
# about what a strong or weak chart means.

以第五章参数 A 与 B 的结果为规划值(观察一致 0.768,κ 为 0.553,偶然一致 0.481),用 κ 的大样本标准误 (Fleiss et al. 1969),要把 κ 的 95% 置信区间半宽压到 0.100,需要 255 张盘;压到 0.050,需要 1,017 张;压到 0.025,需要 4,066 张。几百张盘就足以知道引擎之间是否大体一致。这样的研究应当在任何关于「身强」「身弱」意义的说法之前完成并公开。

一项预注册的配对检验

假说 · 尚未验证

研究方案。 一套完整的排盘与解读规则(历法约定、真太阳时换算、藏干权重、旺衰参数、生成解读的代码)在招募前公开登记,此后不再改动。按第三章的边界校准,报告出生时间落在提示区(误差标准差 15 分钟、出错概率不低于 0.05)的参与者事先排除。每位参与者看到四份去掉姓名、随机排序的解读,其中一份由自己的盘生成,三份由其他参与者的盘生成,挑出最符合自己的一份。主要结局:挑中自己解读的比例;没有信息时为 0.25。检验:单侧精确二项检验,α=0.05\alpha = 0.05。由与作者无经济关系、不知道解读来源的独立分析者执行,结果不论正负都发表。

推导

# Chapter 8. A pre-registered matching test for four-pillar readings.
# Each participant sees four unlabelled readings, one generated from
# their own chart and three from other participants' charts, and picks
# the one that fits best. Chance hit rate 1/4. Births whose reported
# time lies within the boundary zone of p06 (s.d. 15 minutes, P >= 0.05)
# are excluded in advance, since their hour pillar is uncertain; that
# zone is 0.412 of each double-hour, so recruitment must be larger.
from math import comb

def tail(n, k, p):
    return sum(comb(n, i) * p ** i * (1 - p) ** (n - i)
               for i in range(k, n + 1))

def plan(p0, p1, alpha=0.05, power=0.90):
    for n in range(20, 5000):
        k = next(k for k in range(n + 1) if tail(n, k, p0) <= alpha)
        if tail(n, k, p1) >= power:
            return n, k, tail(n, k, p0)

if __name__ == "__main__":
    for p1 in (0.32, 0.35):
        n, k, a = plan(0.25, p1)
        print("   hit rate {:.2f} against 0.25, one-sided 0.05, power 0.90:"
              .format(p1))
        print("     {} analysed participants, at least {} hits (exact size"
              " {:.4f})".format(n, k, a))
        print("     to recruit, allowing for the excluded zone: {}".format(
            round(n / (1 - 0.412) + 0.5)))
    print("\nReading: a modest effect needs a few hundred analysed")
    print("participants; excluding uncertain birth times, as the protocol")
    print("must, raises the number to recruit by about seven tenths.")
#    hit rate 0.32 against 0.25, one-sided 0.05, power 0.90:
#      359 analysed participants, at least 104 hits (exact size 0.0485)
#      to recruit, allowing for the excluded zone: 611
#    hit rate 0.35 against 0.25, one-sided 0.05, power 0.90:
#      179 analysed participants, at least 55 hits (exact size 0.0485)
#      to recruit, allowing for the excluded zone: 305
#
# Reading: a modest effect needs a few hundred analysed
# participants; excluding uncertain birth times, as the protocol
# must, raises the number to recruit by about seven tenths.

要以 0.90 的把握度发现 0.32 对 0.25 的命中率,需要 359 名纳入分析的参与者,至少命中 104 人(实际检验水准 0.0485);若真实命中率为 0.35,179 人即可。因为提示区占每个时辰的 0.412,排除这些出生时间后,需要招募的人数分别约为 611 与 305。

注

这个检验检验什么,不检验什么。 它检验的是:由一个人的盘生成的解读,是否比由别人的盘生成的解读更像他自己。它不检验任何事件的预测。即使结果是否定的,它也不说明用户从解读中得到的感受不真实;它只说明那种感受不依赖于解读是不是由自己的盘生成的。

小结

相信一个排盘软件之前,应当问:它的历法约定是什么,怎样处理出生时间的不确定,判断用哪组参数,以及它说中的是谁。一致性研究可以便宜地测量引擎之间的分歧:255 张盘就能把 κ 定在 ±0.100 之内。一项排除边界出生时间的预注册配对检验,要发现 0.32 对 0.25 的命中率,需要 359 名纳入分析的参与者,约 611 名招募者。

参考文献

Carlson, Shawn. 1985. “A Double-Blind Test of Astrology.” Nature 318: 419–25.
Fleiss, Joseph L., Jacob Cohen, and B. S. Everitt. 1969. “Large Sample Standard Errors of Kappa and Weighted Kappa.” Psychological Bulletin 72 (5): 323–27.

Fan, Y. (2026). Four-Pillar Calendrical Computation and Formal Rule Engines: Julian-Day Sexagenary Cycles, Midnight-Boundary Disagreements, Birth-Time Sensitivity Bounds and Weighted-Graph Strength Scoring [四柱排盘的历法计算与规则引擎] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090180 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).