5D Library › 玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量 · English

第八章 十项审计与一项预注册的盲配对检验

十个问题

本章把全书写成十个可以由脚本检查的问题,适用于任何风水排盘或面相解读服务,包括作者自己的产品。它们不评价任何解读的吉凶。

  1. 是否未说明采用哪一种替卦约定?(第二章)
  2. 是否未说明以真北还是磁北为准?(第三章)
  3. 罗盘误差是否大于 2 度且只读一次?(第三章)
  4. 朝向离交界 3 度以内时是否未作标注?(第三章)
  5. 是否根据 3.8 米以内拍摄的照片读面相?(第四章)
  6. 特征点误差是否大于 1 像素,同时使用区间判定?(第五章)
  7. 是否扫描十个以上的比例来寻找「特别之处」?(第五章)
  8. 证据是否只来自客户见证?(第六章)
  9. 比较结局时是否未按坐向分层?(第六章)
  10. 是否没有记录具体、有日期的预测?(第六章)

审计程序

程序把十个问题写成十个自动标记,用于两个示意的服务:一个「朴素」服务(常见做法),一个按本书各章修正后的「审计后」服务。

推导

# Chapter 8. p15: Ten automatic flags for a chart or face reading.
# Each flag is a yes / no check on how a reading was made; the
# chapter of this book that supplies the threshold is in brackets.
# Two illustrative services: "naive" (common practice) and "audited"
# (after the corrections of this book).
FLAGS = [
    ("replacement-chart convention not stated [2]",
     lambda s: not s["ti_convention"]),
    ("true or magnetic north not stated [3]",
     lambda s: not s["north_stated"]),
    ("compass error above 2 degrees, single reading [3]",
     lambda s: s["sigma_deg"] > 2 and s["readings"] < 3),
    ("facing within 3 degrees of an edge, not flagged [3]",
     lambda s: not s["edge_flag"]),
    ("face read from a photo taken nearer than 3.8 m [4]",
     lambda s: s["photo_cm"] < 377.5),
    ("landmark error above 1 px with band thresholds [5]",
     lambda s: s["landmark_px"] > 1 and s["bands"]),
    ("more than ten ratios scanned for something special [5]",
     lambda s: s["ratios"] > 10),
    ("evidence from testimonials only [6]",
     lambda s: s["testimonials_only"]),
    ("outcomes compared without stratifying by facing [6]",
     lambda s: not s["stratified"]),
    ("no specific, dated predictions recorded [6]",
     lambda s: not s["specific"]),
]

SERVICES = {
    "naive": dict(ti_convention=False, north_stated=False, sigma_deg=4,
                  readings=1, edge_flag=False, photo_cm=30,
                  landmark_px=3, bands=True, ratios=20,
                  testimonials_only=True, stratified=False,
                  specific=False),
    "audited": dict(ti_convention=True, north_stated=True, sigma_deg=2,
                    readings=3, edge_flag=True, photo_cm=400,
                    landmark_px=1, bands=False, ratios=5,
                    testimonials_only=False, stratified=True,
                    specific=True),
}

if __name__ == "__main__":
    for name, sv in SERVICES.items():
        hits = [f for f, test in FLAGS if test(sv)]
        print("   {}: {} of {} flags".format(name, len(hits), len(FLAGS)))
        for f in hits:
            print("     [x] " + f)
    print("\nReading: the naive service trips every flag. The audited one")
    print("trips none, which means only that its readings are")
    print("reproducible; whether they predict anything is the question")
    print("of the blind test in p16.")
#    naive: 10 of 10 flags
#      [x] replacement-chart convention not stated [2]
#      [x] true or magnetic north not stated [3]
#      [x] compass error above 2 degrees, single reading [3]
#      [x] facing within 3 degrees of an edge, not flagged [3]
#      [x] face read from a photo taken nearer than 3.8 m [4]
#      [x] landmark error above 1 px with band thresholds [5]
#      [x] more than ten ratios scanned for something special [5]
#      [x] evidence from testimonials only [6]
#      [x] outcomes compared without stratifying by facing [6]
#      [x] no specific, dated predictions recorded [6]
#    audited: 0 of 10 flags
#
# Reading: the naive service trips every flag. The audited one
# trips none, which means only that its readings are
# reproducible; whether they predict anything is the question
# of the blind test in p16.

朴素服务触发全部十个标记。审计后的服务一个也不触发,但这只说明它的解读可以复现,并不说明它能预测任何事情。后者只能由检验回答。

一项预注册的盲配对检验

假说 · 尚未验证

检验方案。 选取按坐向半区、城市与建成元运配对的住宅,每对中有一户在三年内的预先登记结局较好。排盘师只看到两户的平面图、坐向与建成年份,选出预计结局较好的一户。无技能时命中率为 0.5。精确二项检验,双侧 0.05。由与作者无经济关系的独立分析者按预先登记的代码执行,结果不论正负都发表。

推导

# Chapter 8. p16: A pre-registered blind test of chart readings.
# Pairs of homes are matched on facing half, city and build period;
# within each pair, one household had the better pre-registered
# outcome over three years. A practitioner sees only the two floor
# plans, facings and build years, and picks the home predicted to do
# better. Under no skill the hit rate is 0.5. Exact binomial test,
# two-sided 0.05: the program finds the critical number of hits for n
# pairs and the exact power when the true hit rate is 0.55, 0.60 or
# 0.65, and the smallest n giving power 0.80 for each.
import math

def pmf(n, k, p):
    return math.comb(n, k) * p ** k * (1 - p) ** (n - k)

def critical(n):
    tail, k = 0.0, n
    while k >= 0:
        t = tail + pmf(n, k, 0.5)
        if 2 * t > 0.05:
            return k + 1
        tail, k = t, k - 1
    return 0

def power(n, p):
    c = critical(n)
    return sum(pmf(n, k, p) for k in range(c, n + 1))

if __name__ == "__main__":
    print("   pairs   hits needed   power at 0.55   0.60    0.65")
    for n in (50, 100, 200, 400, 800):
        print("   {:5d} {:13d} {:15.4f} {:7.4f} {:7.4f}".format(
            n, critical(n), power(n, 0.55), power(n, 0.60),
            power(n, 0.65)))
    print()
    for p in (0.65, 0.60, 0.55):
        n = 10
        while power(n, p) < 0.80:
            n += 2
        print("   true hit rate {:.2f}: {} pairs for power 0.80".format(p, n))
    print("\nReading: a practitioner who is right 65 times in 100 can")
    print("show it with under a hundred pairs; a modest edge of 0.55")
    print("needs several hundred. Either way the test is cheap compared")
    print("with a lifetime of untested readings.")
#    pairs   hits needed   power at 0.55   0.60    0.65
#       50            33          0.0765  0.2369  0.5060
#      100            61          0.1343  0.4621  0.8276
#      200           115          0.2617  0.7868  0.9884
#      400           221          0.4806  0.9762  1.0000
#      800           429          0.7932  0.9999  1.0000
#
#    true hit rate 0.65: 90 pairs for power 0.80
#    true hit rate 0.60: 204 pairs for power 0.80
#    true hit rate 0.55: 786 pairs for power 0.80
#
# Reading: a practitioner who is right 65 times in 100 can
# show it with under a hundred pairs; a modest edge of 0.55
# needs several hundred. Either way the test is cheap compared
# with a lifetime of untested readings.

100 对住宅时,需要 61 次命中才算显著;若真实命中率为 0.65,检验力为 0.8276。达到 0.80 的检验力,真实命中率 0.65 需要 90 对,0.60 需要 204 对,0.55 需要 786 对。对一种声称能看出房子吉凶的方法来说,这是一个廉价的检验。

三种真实命中率下盲配对检验的检验力随配对数的变化。点线为 0.80。

小结

十个问题(替卦约定、北的约定、罗盘误差、兼向标注、拍摄距离、标点误差、比例个数、见证、分层、具体预测)都可以写成自动审计。检验排盘能否预测结局的实验应使用按坐向配对的盲选设计;数百对住宅就足以回答这个问题。

Fan, Y. (2026). Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology: Lo-Shu Orbit Cycles, Magnetic Declination Flip Rates and Landmark Measurement Error Propagation [玄空飞星置换代数、二十四山罗盘离散化与骨相比例计量] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090215 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).