5D Library › Autonomic Sympathovagal Balance, Six-Meridian State-Space Models and Multimodal Biomarker Inversion · 中文

Chapter 5. A Three-Modality Screen as a Bayesian Inverse Problem

Three patterns and three signals

Picture a three-minute screen: a structured questionnaire, a pulse read with a phone camera (remote photoplethysmography, rPPG (Verkruysse et al. 2008)), and a voice perturbation score from a short reading. Among the people the screen flags, suppose three patterns are equally common: A “prefrontal fatigue”, B “salience-network anxiety lock” and C “shutdown” (what the polyvagal theory calls the “dorsal vagal freeze”, a notion that is itself disputed (Grossman 2023)). All three names are illustrative labels, not diagnostic categories.

Write this as an inverse problem: given three observed scores, which pattern is most likely? If the three scores are independent given the pattern, the posterior is the product of the three likelihoods.

Calculation

# Chapter 5. p09: A three-minute screen with three modalities. Among
# people the screen flags, three patterns are equally common (prior 1/3):
# A "prefrontal fatigue", B "salience-network anxiety lock", C "shutdown"
# (the polyvagal "dorsal freeze" label). Each modality gives one score in
# standard units with sd 1: a structured questionnaire Q, a camera pulse
# score P (from heart rate and RMSSD) and a voice perturbation score J.
# Illustrative class means below. If the three scores are independent
# given the class, the posterior is the product of the likelihoods
# (likelihood ratios multiply). Misclassification over 30,000 people,
# seed 86.
import random
from math import exp

MEANS = {"A": (0.0, 0.0, 0.5), "B": (1.0, 1.2, 1.0), "C": (0.6, -0.8, -0.5)}

def post(x, use):
    w = {c: exp(-0.5 * sum((x[i] - m[i]) ** 2 for i in use))
         for c, m in MEANS.items()}
    z = sum(w.values())
    return {c: v / z for c, v in w.items()}

def draw(rng, c, rho=0.0):
    f = rng.gauss(0, 1)
    return [m + rho ** 0.5 * f + (1 - rho) ** 0.5 * rng.gauss(0, 1)
            for m in MEANS[c]]

if __name__ == "__main__":
    rng = random.Random(86)
    people = [(c, draw(rng, c)) for _ in range(10000) for c in "ABC"]
    for use, label in (((0,), "questionnaire only"),
                       ((0, 1), "+ camera pulse"),
                       ((0, 1, 2), "+ voice")):
        err = sum(1 for c, x in people
                  if max(post(x, use).items(), key=lambda kv: kv[1])[0] != c)
        print("   {:<19} error {:.3f}".format(label, err / len(people)))
#    questionnaire only  error 0.532
#    + camera pulse      error 0.356
#    + voice             error 0.298

With the questionnaire alone the error is 0.532, not much better than a three-way guess without any signal (about two in three); adding the camera pulse brings it to 0.356, and adding voice to 0.298. Each modality carries some information the others lack.

When the modalities share a cause, naive Bayes is overconfident

The three scores are often not independent: lack of sleep, caffeine and the stress of being measured push questionnaire, pulse and voice in the same direction at once. p10 gives the three scores a common correlation ρ\rho and compares the naive rule that simply multiplies likelihoods with the rule that uses the correct covariance.

Calculation

# Chapter 5. p10: When the three modalities share a cause. General
# arousal (sleep, caffeine, the stress of being measured) moves all three
# scores of p09 together: each score = class mean + shared factor + own
# noise, with correlation rho between scores and sd still 1. Compared:
# the naive rule that multiplies likelihoods as if independent, and the
# correct rule using the equicorrelated covariance, whose inverse is
# (I - rho/(1 + 2 rho) J) / (1 - rho). Reported: error, and how sure the
# naive rule claims to be (mean top posterior) against how often it is
# right. 30,000 people per rho, seed 86.
import importlib.util
import random
from math import exp

def load(name):
    spec = importlib.util.spec_from_file_location(name, name + ".py")
    m = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(m)
    return m

p09 = load("p09_three_modes")

def post_corr(x, rho):
    a = rho / (1 + 2 * rho)
    w = {}
    for c, m in p09.MEANS.items():
        d = [x[i] - m[i] for i in range(3)]
        q = (sum(v * v for v in d) - a * sum(d) ** 2) / (1 - rho)
        w[c] = exp(-0.5 * q)
    z = sum(w.values())
    return {c: v / z for c, v in w.items()}

if __name__ == "__main__":
    rng = random.Random(86)
    print("   rho   naive error  correct error  naive claims  naive right")
    for rho in (0.0, 0.3, 0.6):
        e1 = e2 = claim = 0.0
        n = 0
        for _ in range(10000):
            for c in "ABC":
                x = p09.draw(rng, c, rho)
                pn = p09.post(x, (0, 1, 2))
                pc = post_corr(x, rho)
                top = max(pn, key=pn.get)
                e1 += top != c
                e2 += max(pc, key=pc.get) != c
                claim += pn[top]
                n += 1
        print("   {:.1f}  {:11.3f}  {:13.3f}  {:12.3f}  {:11.3f}".format(
            rho, e1 / n, e2 / n, claim / n, 1 - e1 / n))
#    rho   naive error  correct error  naive claims  naive right
#    0.0        0.298          0.298         0.699        0.702
#    0.3        0.333          0.321         0.704        0.667
#    0.6        0.345          0.290         0.707        0.655

At ρ\rho = 0.6 the naive rule’s error is 0.345 against 0.290 for the correct rule. More important is how sure the naive rule is of itself: the top posterior it reports averages 0.707, while the share it gets right is only 0.655. The stronger the correlation, the wider this gap. A screening tool that reports “seventy per cent confidence” while ignoring the common causes behind its modalities is overstating itself.

Hypothesis · not established

The author’s interpretation (not yet tested): using the questionnaire, camera pulse and voice together separates the fatigue, anxiety-lock and shutdown states more accurately than the questionnaire alone. What would show it wrong: in an independent sample with a structured clinical interview as reference, the three-modality combination shows no statistically reliable gain in accuracy over the questionnaire alone, or the confidence it reports is systematically higher than its actual accuracy.

Summary

Writing the screen as a Bayesian inverse problem shows clearly how much each modality contributes; but adding modalities is honest only when their common causes are modelled correctly. Ignoring the correlation raises the error and, worse, makes the tool claim a certainty it does not have.

References

Grossman, Paul. 2023. “Fundamental Challenges and Likely Refutations of the Five Basic Premises of the Polyvagal Theory.” Biological Psychology 180: 108589.
Verkruysse, Wim, Lars O. Svaasand, and J. Stuart Nelson. 2008. “Remote Plethysmographic Imaging Using Ambient Light.” Optics Express 16 (26): 21434 to 21445.

Fan, Y. (2026). Autonomic Sympathovagal Balance, Six-Meridian State-Space Models and Multimodal Biomarker Inversion: Heart-Rate Variability Spectral Decomposition, Thermoregulatory Phase Drift and Bayesian Syndrome Classification [自主神经交感迷走平衡、六经辨证状态空间与多模态标志物反演] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090227 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).