关于「两项便宜的测量」,《双稳态、内脏脂解与配餐运筹》给出的定量结论是什么?
结论:在一份合成样本上,腰高比的曲线下面积达到 0.9244,指数达到 0.9645,所以血检添加了 0.0400。一条两步规则得分 0.7858,单用指数得分 0.7970,而前者只对少数人开血检。指数的最佳界值 8.705 正落在验证文献给出的位置。第五章从量人转向喂人,先从低碳水的一周所拿走的那种矿物质开始。
数据口径:书中参数均为示意或合成;第四章的样本是生成的;全部数字由书中程序产生;本书不是医疗建议,不作诊断。 第四章在同一份合成样本上得到指数曲线下面积 0.9645 与腰高比 0.9244,血检只加 0.0400,指数最佳界值 8.705。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.0400, 0.7858, 0.7970, 0.9244, 0.9645, 8.705
mean index: resistant 9.1594, sensitive 8.3078 area under the curve: 0.9645 best cutoff 8.705: sensitivity 0.9165, specificity 0.8812 cutoff sensitivity specificity sum minus one 8.300 0.9958 0.4883 0.4840 8.500 0.9770 0.7183 0.6953 8.600 0.9525 0.8115 0.7640 8.700 0.9190 0.8780 0.7970 8.800 0.8558 0.9290 0.7848 9.000 0.6785 0.9825 0.6610 waist-to-height ratio on the same people: area 0.9244 two-step rule, waist ratio at or above 0.52 and then the index: sensitivity 0.8423, specificity 0.9435, sum minus one 0.7858 so the blood test adds 0.0400 to the waist measurement alone
查看完整验算程序
# Chapter 4. p08: The triglyceride-glucose index on the same synthetic
# sample as p07. The index is the natural logarithm of fasting
# triglycerides times fasting glucose divided by two, with both in
# mg/dL, so it is the sum of the two logarithms less the logarithm of
# two. The generator, seed and draw order are identical to p07, so the
# two programs see the same people. Reported: the area under the curve,
# the best cutoff, and what a two-step rule gains over either marker.
import math
import random
SEED, N = 95, 4000
WHTR0, WHTR_G, WHTR_SD = 0.485, 0.100, 0.050
TG0, TG_G, TG_SD = 90.0, 175.0, 0.30
FPG0, FPG_G, FPG_SD = 90.0, 108.0, 0.08
LAT = 0.6
def sample():
rng = random.Random(SEED)
rows = []
for g in (0, 1):
for _ in range(N):
z = rng.gauss(0.0, 1.0)
ew = rng.gauss(0.0, 1.0)
et = rng.gauss(0.0, 1.0)
ef = rng.gauss(0.0, 1.0)
mix = LAT * z + (1.0 - LAT ** 2) ** 0.5 * ew
whtr = WHTR0 + WHTR_G * g + WHTR_SD * mix
ltg = (math.log(TG0) + math.log(TG_G / TG0) * g
+ TG_SD * (LAT * z + (1.0 - LAT ** 2) ** 0.5 * et))
lfpg = (math.log(FPG0) + math.log(FPG_G / FPG0) * g
+ FPG_SD * (LAT * z + (1.0 - LAT ** 2) ** 0.5 * ef))
rows.append((g, whtr, ltg + lfpg - math.log(2.0)))
return rows
def auc(pos, neg):
both = sorted([(v, 1) for v in pos] + [(v, 0) for v in neg])
ranks, i = [0.0] * len(both), 0
while i < len(both):
j = i
while j + 1 < len(both) and both[j + 1][0] == both[i][0]:
j += 1
r = (i + j) / 2.0 + 1.0
for k in range(i, j + 1):
ranks[k] = r
i = j + 1
s = sum(r for r, (_, lab) in zip(ranks, both) if lab == 1)
n1, n0 = len(pos), len(neg)
return (s - n1 * (n1 + 1) / 2.0) / (n1 * n0)
def point(pos, neg, cut):
sens = sum(1 for v in pos if v >= cut) / len(pos)
spec = sum(1 for v in neg if v < cut) / len(neg)
return sens, spec
if __name__ == "__main__":
rows = sample()
pos = [t for g, _, t in rows if g == 1]
neg = [t for g, _, t in rows if g == 0]
print(" mean index: resistant {:.4f}, sensitive {:.4f}"
.format(sum(pos) / len(pos), sum(neg) / len(neg)))
print(" area under the curve: {:.4f}".format(auc(pos, neg)))
best, best_cut = -1.0, 0.0
for i in range(3001):
cut = 7.00 + 0.001 * i
sens, spec = point(pos, neg, cut)
if sens + spec - 1.0 > best:
best, best_cut = sens + spec - 1.0, cut
sens, spec = point(pos, neg, best_cut)
print(" best cutoff {:.3f}: sensitivity {:.4f}, specificity {:.4f}"
.format(best_cut, sens, spec))
print(" cutoff sensitivity specificity sum minus one")
for cut in (8.300, 8.500, 8.600, 8.700, 8.800, 9.000):
sens, spec = point(pos, neg, cut)
print(" {:<9.3f}{:<14.4f}{:<14.4f}{:.4f}"
.format(cut, sens, spec, sens + spec - 1.0))
wp = [w for g, w, _ in rows if g == 1]
wn = [w for g, w, _ in rows if g == 0]
print(" waist-to-height ratio on the same people: area {:.4f}"
.format(auc(wp, wn)))
gate = 0.5200
both_pos = sum(1 for g, w, t in rows
if g == 1 and w >= gate and t >= best_cut)
both_neg = sum(1 for g, w, t in rows
if g == 0 and not (w >= gate and t >= best_cut))
print(" two-step rule, waist ratio at or above {:.2f} and then the"
" index:".format(gate))
print(" sensitivity {:.4f}, specificity {:.4f}, sum minus one {:.4f}"
.format(both_pos / len(pos), both_neg / len(neg),
both_pos / len(pos) + both_neg / len(neg) - 1.0))
print(" so the blood test adds {:.4f} to the waist measurement alone"
.format(auc(pos, neg) - auc(wp, wn)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《胰岛素胰高血糖素双稳态、内脏脂解动力学与线性规划配餐》第 4 章「两项便宜的测量」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090248
DOI: 10.5281/zenodo.24090248 · 阅读本章所在专著 · 5DL-B-095 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026095,
author = {Fan, Yafu},
title = {Insulin-Glucagon Bistability, Visceral Lipolysis Kinetics and Linear-Programming Diet Optimization},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090248},
url = {https://doi.org/10.5281/zenodo.24090248}
}