关于「可识别性:后门、工具变量与公开门槛各需要什么条件」,《先手探针与隐藏事实》给出的定量结论是什么?
结论:情形 B 是更常见的处境。代理变量的准确度 a 为 0.5 时,它与意向毫无关系,分层后的对比值仍是 +0.0700,偏差 +0.1500 原封不动。a 升到 0.7,调整后 +0.0537,偏差 +0.1337;a 到 0.9,调整后 -0.0098,偏差 +0.0702,仍然很大。只有 a 等于 1.0,也就是代理变量完全等于意向时,偏差才归零。代理越像本体,剩下的偏差越小,可是只要不完全一样,偏差就不会消失。日志里那些「渠道」「设备」「时段」,大多只是意向的影子。
数据口径:书中参数为示意,全部计算由书中程序生成,数据全部是合成数据。 本书是非个人化经营建议,不构成法律、税务或投资意见,不向任何人承诺收入。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: -0.0098, 0.0537, 0.0700, 0.0702, 0.1337, 0.1500
| true effect -0.080 | ||
| A | confounder recorded: naive +0.0700 | adjusted -0.0800 |
| B | hidden confounder, stratify on a proxy of accuracy a | |
| a = 0.5: naive +0.0700 | adjusted +0.0700 | bias +0.1500 |
| a = 0.6: naive +0.0700 | adjusted +0.0661 | bias +0.1461 |
| a = 0.7: naive +0.0700 | adjusted +0.0537 | bias +0.1337 |
| a = 0.8: naive +0.0700 | adjusted +0.0303 | bias +0.1103 |
| a = 0.9: naive +0.0700 | adjusted -0.0098 | bias +0.0702 |
| a = 1.0: naive +0.0700 | adjusted -0.0800 | bias +0.0000 |
| C | randomised price, control for a post-price variable: | |
| unadjusted -0.0800 | 'adjusted' -0.1165 |
查看完整验算程序
# Chapter 2. p21: back-door adjustment works when the confounder is seen.
# Exact enumeration over small discrete models (illustrative parameters).
# Purchase probability: 0.10 + 0.25 * (segment) - 0.08 * (high price).
# A: the confounder Z (channel) is recorded -> stratify on Z.
# B: the confounder U is hidden; Z is a proxy that matches U with
# accuracy a -> stratifying on Z leaves part of the bias.
# C: the price is randomised, but we "control for" a variable C that the
# price itself moves (a post-treatment variable) -> bias appears.
import math
EFFECT = -0.08
def buy(u, x):
return 0.10 + 0.25 * u - 0.08 * x
def contrast(joint, key):
# joint: dict (u, z, x) -> prob; adjust for the coordinate 'key'
def p_buy(cond):
num = math.fsum(p * buy(u, x) for (u, z, x), p in joint.items()
if cond(u, z, x))
den = math.fsum(p for (u, z, x), p in joint.items() if cond(u, z, x))
return num / den
naive = p_buy(lambda u, z, x: x == 1) - p_buy(lambda u, z, x: x == 0)
parts = []
for s in (0, 1):
ps = math.fsum(p for k, p in joint.items() if k[key] == s)
d1 = p_buy(lambda u, z, x: x == 1 and (u, z, x)[key] == s)
d0 = p_buy(lambda u, z, x: x == 0 and (u, z, x)[key] == s)
parts.append(ps * (d1 - d0))
return naive, math.fsum(parts)
def model_b(acc):
joint = {}
for u in (0, 1):
for z in (0, 1):
pz = acc if z == u else 1 - acc
for x in (0, 1):
ph = 0.8 if u == 1 else 0.2
joint[(u, z, x)] = 0.5 * pz * (ph if x else 1 - ph)
return joint
if __name__ == "__main__":
print("true effect {:+.3f}".format(EFFECT))
a = model_b(1.0)
n, adj = contrast(a, 0)
print("A confounder recorded: naive {:+.4f} adjusted {:+.4f}"
.format(n, adj))
print("B hidden confounder, stratify on a proxy of accuracy a")
for acc in (0.5, 0.6, 0.7, 0.8, 0.9, 1.0):
n, adj = contrast(model_b(acc), 1)
b = adj - EFFECT
b = 0.0 if abs(b) < 1e-12 else b
print(" a = {:.1f}: naive {:+.4f} adjusted {:+.4f} bias {:+.4f}"
.format(acc, n, adj, b))
# C: x randomised; 'z' slot now holds C, moved by x and by u
joint = {}
for u in (0, 1):
for x in (0, 1):
pc = 0.2 + 0.4 * x + 0.3 * u
for c in (0, 1):
joint[(u, c, x)] = 0.25 * (pc if c else 1 - pc)
n, adj = contrast(joint, 1)
print("C randomised price, control for a post-price variable:")
print(" unadjusted {:+.4f} 'adjusted' {:+.4f}".format(n, adj))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《高能动性主动推理、意念强度先手扰动与商业隐藏事实勘探母典》第 2 章「可识别性:后门、工具变量与公开门槛各需要什么条件」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-395 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026395,
author = {Fan, Yafu},
title = {High-Agency Active Inference, Intentional Perturbation Probes and Hidden Market-Truth Exploration},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}