关于「广告日报:归因噪音、开关试验与预算切换」,《可穿戴读数与广告日报的卡尔曼滤波》给出的定量结论是什么?
结论:第六章转到广告日报:按原始日报切换预算九十天切换 33.8 次、利润只有理想的 0.714,按滤波估计只切换 5.6 次、达到 0.903;花费不变时任何方法都学不到广告效果。
数据口径:本书用局部水平与局部趋势的状态空间模型检验这一常识:一个读数等于真实水平加测量误差,当误差方差远大于真实日变化方差时,按原始读数做是或否的决定会对噪音过度反应;示意参数下原始读数每百天翻转 23.6 次,卡尔曼滤波估计只翻转 5.5 次。 书中的噪音方差、漂移、回报率与预算均为示意参数;全部计算由书中程序生成。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.714, 0.903, 33.8, 5.6
| estimate | switches/90d | wrong-day share | profit (yuan) | vs oracle |
| raw | 33.8 | 0.299 | 11118 | 0.714 |
| mean7 | 7.6 | 0.190 | 13776 | 0.885 |
| kalman | 5.6 | 0.175 | 14060 | 0.903 |
| oracle | 5.0 | 0.000 | 15564 | 1.000 |
| steady Kalman gain here: 0.1130 |
查看完整验算程序
# Chapter 6. p62: Switching the budget on raw vs filtered daily returns.
# True incremental margin per yuan of spend ("true return") starts at
# 1.05 and drifts as a random walk (sd 0.03 a day). The daily report
# shows true return + attribution noise (sd 0.25). Rule each morning:
# if the estimate of today's return is above 1, spend 2000 yuan, else
# 300 yuan (a floor that keeps the campaign measurable). Profit of a
# day = (true return - 1) x spend. Estimates: yesterday's raw report,
# trailing 7-day mean, Kalman (q = 0.03^2, r = 0.25^2), and the oracle
# that sees the true return. 1000 runs of 90 days, fixed seed.
import math
import random
import statistics
SD_Q, SD_R, DAYS, HI, LO = 0.03, 0.25, 90, 2000.0, 300.0
rng = random.Random(20261124)
res = {k: ([], [], []) for k in ("raw", "mean7", "kalman", "oracle")}
for _ in range(1000):
rho, path, rep = 1.05, [], []
for _ in range(DAYS + 1):
path.append(rho)
rep.append(rho + rng.gauss(0, SD_R))
rho += rng.gauss(0, SD_Q)
m, p = rep[0], SD_R ** 2
kal = [m]
for y in rep[1:]:
pp = p + SD_Q ** 2
k = pp / (pp + SD_R ** 2)
m, p = m + k * (y - m), pp * (1 - k)
kal.append(m)
ests = {"raw": rep, "kalman": kal, "oracle": path[1:] + [0.0],
"mean7": [statistics.fmean(rep[max(0, t - 6):t + 1])
for t in range(DAYS + 1)]}
for name, e in ests.items():
prof, flips, wrong, last = [], 0, 0, None
for t in range(1, DAYS + 1):
hi = e[t - 1] > 1.0
prof.append((path[t] - 1) * (HI if hi else LO))
wrong += hi != (path[t] > 1.0)
if last is not None and hi != last:
flips += 1
last = hi
res[name][0].append(math.fsum(prof))
res[name][1].append(flips)
res[name][2].append(wrong / DAYS)
top = statistics.fmean(res["oracle"][0])
print("estimate switches/90d wrong-day share profit (yuan) vs oracle")
for name in ("raw", "mean7", "kalman", "oracle"):
pr = statistics.fmean(res[name][0])
print("%-8s %11.1f %14.3f %12.0f %8.3f"
% (name, statistics.fmean(res[name][1]),
statistics.fmean(res[name][2]), pr, pr / top))
pss = (SD_Q ** 2 + math.sqrt(SD_Q ** 4 + 4 * SD_Q ** 2 * SD_R ** 2)) / 2
print("steady Kalman gain here: %.4f" % (pss / (pss + SD_R ** 2)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《卡尔曼滤波状态空间同化、可穿戴读数观测噪音与广告归因真实信号提纯母典》第 6 章「广告日报:归因噪音、开关试验与预算切换」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-245 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026245,
author = {Fan, Yafu},
title = {Kalman Filtering and State-Space Assimilation: Separating Observation Noise from True Signals in Wearable Readings and Advertising Reports},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}