What does Kalman Filtering for Readings and Ad Reports conclude, in numbers, about “Why Raw Readings Overreact: the Noise-to-Signal Ratio and Decision Flips”?
Answer: A reading is the true level plus measurement error. When the variance of the error far exceeds the variance of the true daily change, decisions taken on raw readings flip often, and most of those flips respond to error; in the illustrative case with a noise-to-signal ratio of 16, raw readings flip 4.26 times as often as the filtered estimate. How much is gained depends entirely on the ratio: near zero the filter is useless, and the larger the ratio the more useful and the more sluggish it becomes. Where, then, does this gain that absorbs a fixed share of the error come from, and how does it relate to the familiar seven-day average and to exponential smoothing? That is the question of the next chapter.
Scope of the numbers: Its noise variances, drifts, returns and budgets are illustrative parameters; all calculations are generated by its programs. On wearable readings it is not medical advice, claims no effect, judges no one's state of health, and asks readers to consult a licensed physician before any self-experiment; on advertising attribution it is not individual business advice.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 4.26
| sd of day-to-day change, true level | 0.502 |
| sd of day-to-day change, readings | 2.858 |
| reading error sd / true change sd | 4.0 |
| call flips per 100 days | |
| true | 4.9 |
| raw | 23.6 |
| kalman | 5.5 |
| share of days the call disagrees with the true call | |
| raw | 0.170 |
| kalman | 0.100 |
| raw flips / kalman flips | 4.26 |
| theory sd of reading change sqrt(q + 2r) | 2.872 |
Key formula
Show the full program
# Chapter 1. p11: Raw daily readings flip a threshold call far more often.
# Model: local level. True level mu[t+1] = mu[t] + eta, eta ~ N(0, q);
# reading y[t] = mu[t] + eps, eps ~ N(0, r). Illustrative wearable-like
# scale: day-to-day true change sd 0.5, single-reading error sd 2.0, so
# the reading error is four times the true daily change. Call: "level
# above its starting value" (threshold 0). Compare the call made on the
# raw reading, on the Kalman estimate and on the true (unseen) level.
# 400 series of 120 days, fixed seed. All numbers are illustrative.
import math
import random
import statistics
SD_ETA, SD_EPS, DAYS, RUNS = 0.5, 2.0, 120, 400
Q, R = SD_ETA ** 2, SD_EPS ** 2
rng = random.Random(20261113)
def kalman(ys, q, r, m=0.0, p=4.0):
out = []
for y in ys:
pp = p + q
k = pp / (pp + r)
m = m + k * (y - m)
p = pp * (1 - k)
out.append(m)
return out
def flips(calls):
n = 0
for a, b in zip(calls, calls[1:]):
if a != b:
n += 1
return n
fl = {"true": [], "raw": [], "kalman": []}
wrong = {"raw": [], "kalman": []}
dy, dmu = [], []
for _ in range(RUNS):
mu, mus, ys = 0.0, [], []
for _ in range(DAYS):
mu += rng.gauss(0, SD_ETA)
mus.append(mu)
ys.append(mu + rng.gauss(0, SD_EPS))
est = kalman(ys, Q, R)
calls = {"true": [v > 0 for v in mus], "raw": [v > 0 for v in ys],
"kalman": [v > 0 for v in est]}
for k in fl:
fl[k].append(flips(calls[k]) / (DAYS - 1))
for k in wrong:
bad = [a != b for a, b in zip(calls[k], calls["true"])]
wrong[k].append(bad.count(True) / DAYS)
dy += [b - a for a, b in zip(ys, ys[1:])]
dmu += [b - a for a, b in zip(mus, mus[1:])]
print("sd of day-to-day change, true level : %.3f" % statistics.pstdev(dmu))
print("sd of day-to-day change, readings : %.3f" % statistics.pstdev(dy))
print("reading error sd / true change sd : %.1f" % (SD_EPS / SD_ETA))
print("call flips per 100 days")
for k in ("true", "raw", "kalman"):
print(" %-7s %6.1f" % (k, 100 * statistics.fmean(fl[k])))
print("share of days the call disagrees with the true call")
for k in ("raw", "kalman"):
print(" %-7s %6.3f" % (k, statistics.fmean(wrong[k])))
ratio = statistics.fmean(fl["raw"]) / statistics.fmean(fl["kalman"])
print("raw flips / kalman flips: %.2f" % ratio)
print("theory sd of reading change sqrt(q + 2r) = %.3f"
% math.sqrt(Q + 2 * R))Single source and citation
Fan, Y. (2026). Kalman Filtering and State-Space Assimilation: Separating Observation Noise from True Signals in Wearable Readings and Advertising Reports (Version 1.0.0), Chapter 1: Why Raw Readings Overreact: the Noise-to-Signal Ratio and Decision Flips. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 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}
}Other chapter answers in this book
- Chapter 2 · Where the Kalman Gain Comes From: One Prediction, One Correction and Exponential Smoothing
- Chapter 3 · Trends and Steps: Slow Drift Takes Weeks to Show, a Real Jump Costs Days of Lag
- Chapter 4 · Looking Back and Filling Gaps: the RTS Smoother, Missing Days and Artefact Readings
- Chapter 5 · How Large Is the Noise? Maximum Likelihood, Innovation Tests and Moments of Differences
- Chapter 6 · The Advertising Report: Attribution Noise, On/Off Flighting and Budget Switching
- Chapter 7 · Classical Sources East and West: the Mencius and Gauss's Least Squares
- Chapter 8 · Closing the Loop: a Four-Week Filtered Log, Filtered Advertising Reports and Pre-Registered Tests