5D Library › 纳甲装卦与奇门遁甲排盘的组合计算 · English

第八章 约定预算与一项预注册的配对检验

相信一个装卦或奇门软件之前的四个问题

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

一、它的规则表从哪里来? 八宫、纳甲、六神、旬空、局数都可以由闭式生成(第一至三章)。软件应当用闭式核对它的表,而不只是照抄。

二、它用的是哪一种历法与哪一套格局规则? 拆补还是置闰(第三章),入墓用哪一种写法(第六章),时辰按钟表还是真太阳时(第 66 本)。

三、结果对约定与时刻有多敏感? 软件应当报告换一种说得通的约定、或把时刻移到相邻时辰后,盘与格局的变化。

四、它说中的是什么? 要衡量一份解读是否与提问者的处境有关,需要盲法的配对检验,而不是事后的「准不准」评分 (Carlson 1985)。

约定预算

把前面各章算出的、两个引擎可能取法不同的约定排成一张表,就得到一份「约定预算」。

推导

# Chapter 8. A convention budget for two Qimen engines.
# Each line is a choice two programs can make differently, with the share
# of bureau-hours it affects, as computed earlier in this book (p06 and
# p11) or in Volume 66 (true solar time, Shanghai and Kuala Lumpur). If
# the choices were independent, the share of hours on which two engines
# that differ in all of them show the same chart is the product of the
# shares unaffected.
BUDGET = (
    ("calendar: split-supplement vs intercalation", 0.3067),   # p06
    ("tomb rule: common vs yang-dies", 0.1944),                 # p11
    ("hour from the clock vs true solar time, Shanghai", 0.069),
    ("hour from the clock vs true solar time, Kuala Lumpur", 0.610),
)

def same_share(shares):
    out = 1.0
    for s in shares:
        out *= 1 - s
    return out

if __name__ == "__main__":
    for name, s in BUDGET:
        print("   {:52s} {:.4f}".format(name, s))
    for city, solar in (("Shanghai", BUDGET[2][1]),
                        ("Kuala Lumpur", BUDGET[3][1])):
        same = same_share((BUDGET[0][1], BUDGET[1][1], solar))
        print("   {:12s}: engines differing in all three choices show"
              .format(city))
        print("                 a different chart or verdict on {:.4f}"
              " of hours".format(1 - same))
    print("\nReading: before any question of meaning, two honest engines")
    print("that make different but defensible choices disagree on about")
    print("half of all hours in Shanghai and on most hours in Kuala Lumpur.")
#    calendar: split-supplement vs intercalation          0.3067
#    tomb rule: common vs yang-dies                       0.1944
#    hour from the clock vs true solar time, Shanghai     0.0690
#    hour from the clock vs true solar time, Kuala Lumpur 0.6100
#    Shanghai    : engines differing in all three choices show
#                  a different chart or verdict on 0.4800 of hours
#    Kuala Lumpur: engines differing in all three choices show
#                  a different chart or verdict on 0.7822 of hours
#
# Reading: before any question of meaning, two honest engines
# that make different but defensible choices disagree on about
# half of all hours in Shanghai and on most hours in Kuala Lumpur.

历法的选择影响 0.3067 的时辰,入墓规则影响 0.1944 的局时,钟表时间与真太阳时在上海影响 0.0690、在吉隆坡影响 0.6100 的时辰(第 66 本)。若这些选择互相独立,两个在三项上都取法不同的引擎,在上海对 0.4800 的时辰给出不同的盘或判断,在吉隆坡为 0.7822。独立是一个近似;它的用处是说明量级:在问任何意义之前,两个诚实而取法不同的引擎,对大约一半的时辰意见不一。

一项预注册的配对检验

假说 · 尚未验证

研究方案。 一套完整的引擎(历法、真太阳时换算、格局规则、生成解读的代码)在招募前公开登记,此后不再改动。参与者记录一个问题与提问的时刻;独立分析者用登记的引擎写出三份解读:一份由提问时刻的盘生成,两份由随机选取的其他局时生成。事后,参与者在不知道来源的情况下挑出最符合实际情形的一份。主要结局:挑中真实时刻解读的比例;没有信息时为三分之一。检验:单侧精确二项检验,α=0.05\alpha = 0.05。由与作者无经济关系、不知道解读来源的独立分析者执行,结果不论正负都发表。

推导

# Chapter 8. A pre-registered matching test for Qimen readings.
# A participant records a question and the moment it is asked. An
# independent analyst writes three readings with one registered engine:
# one from the chart of that moment and two from charts of randomly
# chosen other bureau-hours; the participant, later and blind, picks the
# reading that best fits what happened. Chance hit rate 1/3.
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.40, 0.45):
        n, k, a = plan(1 / 3, p1)
        print("   hit rate {:.2f} against 1/3, one-sided 0.05, power 0.90:"
              .format(p1))
        print("     {} participants, at least {} hits (exact size {:.4f})"
              .format(n, k, a))
    print("\nReading: a hit rate of 0.40 needs a few hundred participants,")
    print("0.45 well under two hundred. The engine, its calendar and its")
    print("pattern rules must be registered first, since by p15 a change")
    print("of convention alone changes the chart for about half of hours.")
#    hit rate 0.40 against 1/3, one-sided 0.05, power 0.90:
#      447 participants, at least 166 hits (exact size 0.0498)
#    hit rate 0.45 against 1/3, one-sided 0.05, power 0.90:
#      152 participants, at least 61 hits (exact size 0.0468)
#
# Reading: a hit rate of 0.40 needs a few hundred participants,
# 0.45 well under two hundred. The engine, its calendar and its
# pattern rules must be registered first, since by p15 a change
# of convention alone changes the chart for about half of hours.

要以 0.90 的把握度发现 0.40 对三分之一的命中率,需要 447 名参与者,至少命中 166 人(实际检验水准 0.0498);若真实命中率为 0.45,152 人即可,至少命中 61 人。提问时刻应当按第六章的结论处理:落在时辰交界附近的提问,事先规定是排除还是按哪一个时辰起盘。

注

这个检验检验什么,不检验什么。 它检验的是:由提问时刻的盘生成的解读,是否比由其他时刻的盘生成的解读更贴合提问者的处境。它不检验择时或任何决策的效果。即使结果是否定的,它也不说明使用者从解读中得到的帮助不真实;它只说明那种帮助不依赖于盘是不是提问时刻的盘。

小结

相信一个装卦或奇门软件之前,应当问:它的表能否由闭式核对,用哪一种历法与格局规则,结果对约定与时刻多敏感,以及它说中的是什么。一份约定预算显示,两个取法不同的引擎在上海对约一半的时辰意见不一。一项预注册的配对检验,要发现 0.40 对三分之一的命中率,需要 447 名参与者。

参考文献

Carlson, Shawn. 1985. “A Double-Blind Test of Astrology.” Nature 318: 419–25.

Fan, Y. (2026). Najia Hexagram Encoding and Qimen Dunjia Combinatorial Engines: Eight-Palace Group Actions, Sexagenary Void Cosets, Split-Supplement versus Intercalation Divergences and Nine-Palace Rotor Permutations [纳甲装卦与奇门遁甲排盘的组合计算] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090182 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).