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

Chapter 3. Drift in the Temperature Rhythm and the Core-to-Fingertip Gradient

How many days before the peak can be read?

Core body temperature follows a rhythm of about twenty-four hours, with a mean (mesor) of about 36.9 °C, an amplitude of about 0.40 °C and a peak usually in the early evening. Cosinor fitting uses least squares on the cosine and sine of the 24-hour cycle to give the mean, the amplitude and the time of the peak (Cornelissen 2014). Real recordings are harder to read than white noise: the time of the peak wanders from day to day by itself, and activity, meals and sleep add slow disturbances that are correlated in time. p05 includes both kinds of noise.

Calculation

# Chapter 3. p05: Reading a temperature rhythm (cosinor). Core temperature
# is sampled every 10 minutes: mesor 36.9 deg C, amplitude 0.40 deg C,
# peak (acrophase) at 17:00. Real recordings are messier than white
# noise: the peak wanders from day to day (sd 40 min) and activity, meals
# and sleep add slow, correlated noise (AR(1), lag-1 correlation 0.95,
# sd 0.15 deg C). Least squares on cos and sin of the 24 h cycle gives mesor,
# amplitude and acrophase; their spread over 500 repeats (seed 86) shows
# how many days are needed before a 1-hour drift in the peak can be seen.
import random
from math import atan2, cos, pi, sin, sqrt

def series(rng, days, shift_h=0.0):
    out, e = [], rng.gauss(0, 0.15)
    for d in range(days):
        jit = rng.gauss(0, 40 / 60.0)
        for i in range(144):
            t = d * 24 + i / 6.0
            e = 0.95 * e + sqrt(1 - 0.95 ** 2) * rng.gauss(0, 0.15)
            out.append((t, 36.9 + 0.40 * cos(
                2 * pi * (t - 17 - shift_h - jit) / 24) + e))
    return out

def cosinor(data):
    n = len(data)
    c = [cos(2 * pi * t / 24) for t, _ in data]
    s = [sin(2 * pi * t / 24) for t, _ in data]
    y = [v for _, v in data]
    m = sum(y) / n
    # cos and sin are orthogonal over whole days
    b = 2 * sum(ci * (yi - m) for ci, yi in zip(c, y)) / n
    g = 2 * sum(si * (yi - m) for si, yi in zip(s, y)) / n
    amp = sqrt(b * b + g * g)
    peak = (atan2(g, b) * 24 / (2 * pi)) % 24
    return m, amp, peak

if __name__ == "__main__":
    rng = random.Random(86)
    print("   days  mean peak   sd of peak (min)  amplitude  1 h shift seen")
    for days in (1, 2, 3, 7):
        peaks, amps, seen = [], [], 0
        for _ in range(500):
            _, a, p = cosinor(series(rng, days))
            _, _, q = cosinor(series(rng, days, 1.0))
            peaks.append(p)
            amps.append(a)
            seen += (q - p) > 0.5
        mp = sum(peaks) / 500
        sd = sqrt(sum((p - mp) ** 2 for p in peaks) / 499)
        print("   {:4d}  {:9.2f}   {:16.1f}  {:9.3f}  {:14.3f}".format(
            days, mp, 60 * sd, sum(amps) / 500, seen / 500))
#    days  mean peak   sd of peak (min)  amplitude  1 h shift seen
#       1      16.94               60.7      0.414           0.652
#       2      16.99               41.9      0.401           0.728
#       3      17.03               35.5      0.399           0.710
#       7      16.99               23.5      0.396           0.836

With one day of data the standard deviation of the peak time is 60.7 minutes, and a one-hour drift in the peak has only a 0.652 chance of being seen; after seven days in a row the standard deviation falls to 23.5 minutes and the chance of seeing the drift rises to 0.836. The amplitude estimate stays close to 0.40 for every number of days (0.396 to 0.414). The conclusion is direct: one or two days of temperature records are not enough to judge whether the rhythm has moved earlier or later; at least a week is needed.

The core-to-fingertip gradient must be measured together with room temperature

Constriction and dilation of the small vessels in the hands are controlled mainly by sympathetic nerves, so fingertip skin temperature can serve as a window on vasomotor tone (Kräuchi et al. 1999). A simple heat balance puts fingertip skin temperature between room temperature and core temperature; the wider the dilation vv, the closer the fingertip comes to the core.

Calculation

# Chapter 3. p06: The core-to-fingertip temperature gradient as a window
# on vasomotor (sympathetic) tone, and why room temperature must be
# measured with it. A simple heat balance puts fingertip skin between room
# and core: T_skin = T_room + (T_core - T_room) * h, where h = 0.25 + 0.6 v
# rises with the dilation v (0 = clamped shut, 1 = wide open). Inverting
# a measured gradient for v with the room temperature known, or only
# assumed to be 25 deg C when it is really 22 to 28, over 4,000 readings
# with 0.3 deg C sensor noise. Seed 86.
import random
from math import sqrt

def skin(core, room, v):
    return room + (core - room) * (0.25 + 0.6 * v)

def invert(grad, core, room):
    h = 1 - grad / (core - room)
    return min(1.0, max(0.0, (h - 0.25) / 0.6))

if __name__ == "__main__":
    rng = random.Random(86)
    print("   dilation v  gradient at 22 / 25 / 28 deg C room")
    for v in (0.1, 0.5, 0.9):
        g = [37.0 - skin(37.0, r, v) for r in (22.0, 25.0, 28.0)]
        print("   {:10.1f}  {:5.2f} / {:5.2f} / {:5.2f}".format(v, *g))
    err_known = err_assumed = 0.0
    for _ in range(4000):
        v, room = rng.random(), rng.uniform(22.0, 28.0)
        g = 37.0 - skin(37.0, room, v) + rng.gauss(0, 0.3)
        err_known += (invert(g, 37.0, room) - v) ** 2
        err_assumed += (invert(g, 37.0, 25.0) - v) ** 2
    print("   rms error of v: room measured {:.3f}, room assumed {:.3f}"
          .format(sqrt(err_known / 4000), sqrt(err_assumed / 4000)))
#    dilation v  gradient at 22 / 25 / 28 deg C room
#           0.1  10.35 /  8.28 /  6.21
#           0.5   6.75 /  5.40 /  4.05
#           0.9   3.15 /  2.52 /  1.89
#    rms error of v: room measured 0.042, room assumed 0.115

For the same dilation v=0.5v = 0.5, the gradient is 6.75 °C in a 22 °C room and only 4.05 °C in a 28 °C room. When vv is worked back from the gradient, the root-mean-square error is 0.042 if room temperature is measured as well; if room temperature is only assumed to be 25 °C, the error rises to 0.115, almost three times as large.

Note

Minimum requirements for recording: record the temperature rhythm for at least seven days in a row; each time fingertip temperature is read, record room temperature too, and state the site of measurement and the time allowed to settle. A reading of “cold hands and feet” without room temperature cannot be compared across days or across people.

Summary

The peak and amplitude of the temperature rhythm can be read by cosinor fitting, but the day-to-day wandering of the peak and slow noise make a one-hour drift almost impossible to judge from one day of data; the core-to-fingertip gradient reflects vasomotor tone, provided room temperature is measured at the same time. Both serve in Chapter 4 as observations in the six-stage state model.

References

Cornelissen, Germaine. 2014. “Cosinor-Based Rhythmometry.” Theoretical Biology and Medical Modelling 11: 16.
Kräuchi, Kurt, Christian Cajochen, Esther Werth, and Anna Wirz-Justice. 1999. “Warm Feet Promote the Rapid Onset of Sleep.” Nature 401: 36 to 37.

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).