Chronobiology · Methods

Calculating Circadian Rhythm Metrics

Kairis v1.1

01 A short primer on circadian rhythms

A circadian rhythm is a roughly-24-hour oscillation in some physiological variable, generated endogenously and entrained to environmental cues (primarily light). The master clock sits in the suprachiasmatic nucleus (SCN) of the hypothalamus, and most peripheral tissues — liver, muscle, gut, pancreas — also carry their own molecular clocks that the SCN coordinates through hormonal and neural signals.[1]

A few terms used throughout:

Phase The position within the 24-hour cycle, expressed as a clock time or angle (0–360°).
Acrophase The phase at which the variable peaks. The defining timing parameter.
MESOR Midline Estimating Statistic Of Rhythm — the rhythm-adjusted mean around which the curve oscillates.
Amplitude Half the peak-to-trough range. Peak = MESOR + amplitude; trough = MESOR − amplitude.
Entrainment Synchronizing an endogenous oscillator to an external cue (a zeitgeber). Light is the dominant zeitgeber for the SCN.
DLMO Dim-Light Melatonin Onset. The clock time at which melatonin starts rising in the evening under dim conditions. The gold-standard circadian phase marker.[2, 3]

We treat each circadian marker as a sinusoid (or a sum of several sinusoids) running at a 24-hour period, and the SCN keeps them in approximate phase relationships with each other. The task is then to evaluate one of those sinusoids at an arbitrary time t.


02 The cosinor model

The standard mathematical model in chronobiology is the cosinor, a single-cosine fit to time-series data.[4, 5]

$$y(t) = M + A \cos(\omega t - \varphi)$$

The parameters are the mesor $M$, amplitude $A$, acrophase $\varphi$ (in radians), and angular frequency $\omega = 2\pi/\tau$ where $\tau$ is the period (24 hours). With $\tau$ fixed, three free parameters — $M$, $A$, and $\varphi$ — define the curve. The function attains its maximum when $\omega t = \varphi$, so the clock time of peak is:

$$t_{\text{peak}} = \frac{\varphi}{\omega} = \frac{\varphi\,\tau}{2\pi}$$

If you are familiar with signal processing, this is the DC component plus the first harmonic of a Fourier series. The single-component cosinor provides a good first approximation for most circadian variables. Real biological data also contains higher harmonics (e.g., heart rate is bimodal), but the first harmonic dominates and a single-cosine fit is a reasonable starting point.

Internally, each marker stores a cosinor triplet $(M, A, \varphi)$ derived from published literature, with the acrophase expressed as hours after a phase reference rather than as an absolute clock time. Using DLMO-relative acrophases is the central design idea behind modeling circadian values in Kairis.


03 Anchoring: why DLMO and not clock time

The problem with clock time is that the same clock hour means different things to different bodies. The fix is to anchor every curve to an internal phase marker rather than to the wall clock.

DLMO is the obvious choice because of the following:

  • It is a true SCN-driven event, not confounded by activity or posture.
  • It is the most commonly reported phase marker in the literature, so acrophase values from cosinor papers translate directly to DLMO-relative phases.
  • It correlates reliably with the sleep–wake cycle in normally entrained healthy adults.

On the third point: Burgess et al. (2003)[6] found that wake time was a substantially stronger predictor of DLMO than bedtime in young healthy adults on a fixed schedule ($r = 0.77$ vs. $r = 0.36$ for bedtime). On a population basis, DLMO occurred approximately 14 hours after wake time and approximately 2 hours before bedtime — but the wake-time relationship was the much tighter one.

Since Kairis collects both bedtime and wake time, the estimator uses the stronger anchor:

Primary estimator — wake-time based

$$\text{DLMO} \approx t_{\text{wake}} + 14\text{ h} \pmod{24\text{ h}}$$

For a person who wakes at 07:00, DLMO is placed at 21:00. The bedtime-based rule — DLMO ≈ bedtime − 2 h — yields the same population mean but with noticeably more variance per Burgess, and is computed as a sanity check rather than used as the primary anchor.

Every marker's stored acrophase is expressed as hours elapsed since DLMO. At query time, the input clock instant is mapped to its DLMO-relative phase $h$:

$$h = \bigl((t - \text{DLMO}) \bmod 86400\bigr) \mathbin{/} 3600$$

and the cosinor (or keypoint table — see below) is evaluated at $h$.

Example — baseline cortisol

For a normal sleeper (wake at 07:00, sleep by 23:00 → DLMO at ~21:00), 08:00 lands at phase +11 h. Cortisol's baseline cosinor acrophase is stored at +11 h, so the baseline component peaks at 08:00. The full cortisol model adds a wake-locked CAR transient on top (described in the next section), which shifts the observed summed peak to approximately 07:30–07:45.

The wake-time-to-DLMO rule assumes the person's SCN is entrained to their reported schedule. For the common case (e.g., a shift worker, jet-lagged traveller, or person with an irregular schedule) whose SCN has not actually shifted, the relationship breaks down. The function returns a population estimate under entrainment, not a personalized circadian phase (for now).


04 Cosinor versus keypoints

Asymmetry. Several markers are essentially unimodal over the circadian day but too asymmetric for a symmetric cosine to fit. Blood pressure has a sharp nocturnal trough, a steep "morning surge" at awakening, and a broad daytime elevation that declines gradually into the night[7, 8], then a fast-up, slow-down shape a single cosine smooths away. Heart rate is similar. Under constant-routine and forced-desynchrony protocols, the endogenous circadian drive is a single broad daytime peak with a sharp trough in the biological night, not a symmetric wave.[27] Cortisol is the most extreme case. A near-vertical spike in the cortisol awakening response (CAR), then a long slow decay through the day.[9] A single cosine cannot represent any of these profiles, so each is stored as keypoints instead.

Heart rate and double peaks. Free-living wearable data shows heart rate with two daily peaks: a morning peak and an evening peak.[10] That bimodality is driven largely by the day/night distribution of activity, posture, and meals rather than by the circadian clock itself; the same double-peak appears in cardiovascular event risk and is generally attributed to behavioral triggers.[27] Because Kairis models the endogenous circadian component (the curve your physiology would follow absent behavioral masking) the heart-rate profile here is the underlying unimodal drive, and the keypoint representation exists to capture its asymmetry, not a second peak.

Bimodality. Sleep propensity is genuinely bimodal even in the endogenous signal: a deep minimum at the wake-maintenance zone (roughly 2 hours before habitual bedtime) and a secondary post-lunch dip in alertness around 14:00, with the strongest sleep drive in the biological night.[11, 12] A single cosine collapses these into one peak, so this marker also uses keypoints.

Localized events. Growth hormone (GH) is a single pulse lasting 1–3 hours, locked to sleep onset.[13] There is no meaningful "rhythm" outside that pulse. A cosine would predict GH rising from mid-afternoon onward, which is wrong. The fix is the same keypoint representation, evaluated by cyclic linear interpolation and keyed on the marker's anchor phase so it handles arbitrary schedules correctly. Each marker stores both representations - the evaluator selects the keypoint path for non-sinusoidal shapes and the cosinor path for the rest.


05 Circadian anchors

DLMO works as the master anchor for SCN-driven rhythms, but two markers genuinely live on a different clock, and a third is a hybrid.

Growth hormone is sleep-locked. The GH pulse fires within approximately 30 minutes of the first slow-wave-sleep episode, regardless of when sleep occurs.[13, 14] Anchoring GH to DLMO would place the pulse in the wrong window for anyone sleeping off-schedule. GH uses bedtime as its anchor instead.

Bowel motility is wake-locked. The post-wake colonic motility burst is driven by the act of waking itself — the autonomic transition, the cortisol surge, the postural shift — rather than by central circadian phase. Rao et al. observed a roughly threefold increase in colonic motor activity at waking.[15, 16] Wake time is the correct anchor.

Cortisol is hybrid. It has a true circadian rhythm (the slow rise from ~02:00 to ~08:00, then a slow decay) and a wake-locked transient: the cortisol awakening response — a sharp spike peaking approximately 30–45 minutes after waking.[9, 17] The right model is a DLMO-anchored baseline with a wake-locked Gaussian overlay:

$$\text{cortisol}(t) = \text{baseline}(t) + 0.30\cdot\exp\!\left(-\frac{(t-\mu)^2}{2\sigma^2}\right)$$

where $\mu = t_{\text{wake}} + 0.5\text{ h}$ and $\sigma = 0.5\text{ h}$, clamped to $[0, 1]$. The Gaussian shape parameters approximate the CAR profile described by Clow et al. The 0.30 coefficient is tuned by inspection — not fit to a calibration dataset — so the CAR contributes a meaningful but not dominant spike on top of the circadian baseline.

For the canonical schedule (wake 07:00, bed 23:00, DLMO 21:00), the baseline cosinor peaks at 08:00 and the CAR Gaussian peaks at 07:30. The summed curve peaks at approximately 07:30–07:45, consistent with the empirical CAR timing.

This three-anchor strategy is the single most consequential design decision in the function. Anchoring everything to DLMO — or worse, to clock time — produces confidently wrong answers for at least three of the sixteen supported markers.


06 Sex and age

Most circadian parameters vary modestly by sex and age. A few vary substantially:

  • Testosterone amplitude in males drops from approximately 30% peak-to-trough at age 25 to approximately 10% at age 70, as the morning surge progressively attenuates.[18]
  • Heart rate amplitude is higher in males and declines with age in both sexes; the modifier is derived from sex- and age-stratified statistics in Natarajan et al.[10]
  • Growth hormone declines markedly after age 30 — the "somatopause" — with the sleep-linked pulse progressively attenuating.[19]
  • Cortisol acrophase advances approximately 30 minutes in adults over 60, with overall 24-hour cortisol levels tending to rise slightly with age.[20]
  • Body temperature and sleep timing: in older adults, waking occurs at an earlier clock time relative to the body temperature nadir, reducing the phase angle between waking and the thermal trough rather than straightforwardly shifting the nadir earlier.[21]

Rather than storing separate parameter sets for every demographic combination, these are modelled as scalar multipliers applied at evaluation time. For growth hormone, the somatopause decline is approximated by an exponential in age:

$$A_{\text{GH}}(\text{age}) = A_0 \cdot 0.5^{\,\max(0,\;\text{age} - 30)\,/\,10}$$

floored at a small residual to avoid returning exactly zero. Acrophase shifts are applied additively in phase space. These are population-mean adjustments; individual variation within any sex × age cell is substantial,[3] and the function returns a population estimate, not a personal prediction.

Sex and age factoring will be available in Kairis v1.2.


07 Validation

Acrophase data from one set of papers, amplitude data from another, normalization by hand — there are many places to introduce errors. The validation strategy is to evaluate all sixteen curves on the canonical schedule (wake 07:00, bed 23:00) and check against six anchor facts the literature treats as settled:

  1. Cortisol peaks 30–45 minutes after waking.[9] Should peak at 07:30–07:45.
  2. Body temperature nadirs approximately 2–3 hours before waking.[22] Should trough at 04:00–05:00.
  3. Melatonin peaks approximately 3–5 hours after DLMO.[23] Should peak between 00:00 and 02:00.
  4. Muscle strength peaks 16:00–20:00.[24] Should show peak in this window.
  5. Sleep propensity is minimum at the wake-maintenance zone, approximately 2 hours before bedtime.[11] Should trough at 21:00.
  6. Glucose tolerance peaks in the early morning and is substantially lower in the evening. Morris et al. attributed the morning-evening difference primarily to greater pancreatic β-cell function (insulin secretion) in the biological morning, not to insulin sensitivity per se.[25] The glucose-tolerance curve should peak around 08:00.

If any curve is more than an hour off, the error is almost always in the anchor logic: wrong anchor type, wrong sign on a phase shift, or missing modular reduction. Thanks to the wealth of clinical studies, this can be easily validated in a series of tests against published values.


08 Caveats

The cosinor is an approximation.

It does not capture ultradian pulsatility (cortisol pulses every 60–90 minutes within the daily envelope), seasonal modulation, or menstrual cycle effects on body temperature. These are below the model's resolution.

Inter-individual variability is large.

DLMO ranges from approximately 19:00 to 01:00 across normal-population chronotypes,[3] and timing relative to habitual sleep can vary by several hours between individuals even on a fixed schedule. For better personal accuracy, pairing with a chronotype questionnaire (MEQ or MCTQ) or actigraphy-derived sleep midpoint lets you feed an adjusted DLMO into the evaluator.

The wake-time-to-DLMO rule degrades under non-entrained conditions.

It is reasonably accurate for normally entrained adults on a regular sleep schedule but breaks down for shift workers, jet-lagged travellers, and people with circadian rhythm sleep-wake disorders whose SCN is not aligned with their reported sleep–wake times.

The bowel motility curve is the weakest in the set.

No validated cosinor parameters exist for this marker; it was synthesized from qualitative literature on colonic high-amplitude propagating contractions and the gastrocolic reflex.[15, 26] Treat it as a directional approximation.

Most underlying data was collected on young healthy male participants.

Generalization to clinical populations, pregnancy, paediatric and geriatric users, or athletes is not well validated.

These are normalized position estimates, not absolute physiological values.

A result of 0.7 for cortisol means "70% of the way from the typical daily trough to the typical daily peak" — not a blood concentration. This distinction matters until physiological sensors that measure a person's internal environment are widely available.

References

  1. 1 Mohawk JA, Green CB, Takahashi JS. Central and peripheral circadian clocks in mammals. Annu Rev Neurosci 2012;35:445–62. PMC3710582
  2. 2 Benloucif S, Burgess HJ, Klerman EB, et al. Measuring melatonin in humans. J Clin Sleep Med 2008;4(1):66–9. PMC2276833
  3. 3 Kennaway DJ. The dim light melatonin onset across ages, methodologies, and sex and its relationship with morningness/eveningness. Sleep 2023;46(5):zsad033. PMC10171641
  4. 4 Halberg F, Tong YL, Johnson EA. Circadian system phase — an aspect of temporal morphology; procedures and illustrative examples. In: Mayersbach HV, ed. The Cellular Aspects of Biorhythms (Symposium on Biorhythms). Springer-Verlag; 1967:20–48.
  5. 5 Cornelissen G. Cosinor-based rhythmometry. Theor Biol Med Model 2014;11:16. PMC3991883
  6. 6 Burgess HJ, Savic N, Sletten T, et al. The relationship between the dim light melatonin onset and sleep on a regular schedule in young healthy adults. Behav Sleep Med 2003;1(2):102–14. PubMed
  7. 7 Smolensky MH, Hermida RC, Castriotta RJ, Portaluppi F. Role of sleep-wake cycle on blood pressure circadian rhythms and hypertension. Sleep Med 2007;8(6):668–80. DOI
  8. 8 Smolensky MH, Hermida RC, Portaluppi F. Circadian mechanisms of 24-hour blood pressure regulation and patterning. Sleep Med Rev 2017;33:4–16. DOI
  9. 9 Clow A, Hucklebridge F, Stalder T, Evans P, Thorn L. The cortisol awakening response: more than a measure of HPA axis function. Neurosci Biobehav Rev 2010;35(1):97–103. DOI
  10. 10 Natarajan A, Gleichauf K, Khalid M, Heneghan C, Schneider LD. Circadian rhythm of heart rate and activity: a cross-sectional study. Chronobiol Int 2025;42(1):108–21. DOI
  11. 11 Lavie P. Ultrashort sleep-waking schedule. III. 'Gates' and 'forbidden zones' for sleep. Electroencephalogr Clin Neurophysiol 1986;63(5):414–25. DOI
  12. 12 Dijk DJ, Czeisler CA. Contribution of the circadian pacemaker and the sleep homeostat to sleep propensity, sleep structure, electroencephalographic slow waves, and sleep spindle activity in humans. J Neurosci 1995;15(5):3526–38. DOI
  13. 13 Takahashi Y, Kipnis DM, Daughaday WH. Growth hormone secretion during sleep. J Clin Invest 1968;47(9):2079–90. PMC297368
  14. 14 Van Cauter E, Plat L. Physiology of growth hormone secretion during sleep. J Pediatr 1996;128(5 Pt 2):S32–7. PubMed
  15. 15 Rao SS, Sadeghi P, Beaty J, Kavlock R, Ackerson K. Ambulatory 24-h colonic manometry in healthy humans. Am J Physiol Gastrointest Liver Physiol 2001;280(4):G629–39. DOI
  16. 16 Hoogerwerf WA. Role of biological rhythms in gastrointestinal health and disease. Rev Endocr Metab Disord 2009;10(4):293–300. DOI
  17. 17 Law R, Hucklebridge F, Thorn L, Evans P, Clow A. State variation in the cortisol awakening response. Stress 2013;16(5):483–92. PubMed
  18. 18 Bremner WJ, Vitiello MV, Prinz PN. Loss of circadian rhythmicity in blood testosterone levels with aging in normal men. J Clin Endocrinol Metab 1983;56(6):1278–81. DOI
  19. 19 Van Cauter E, Latta F, Nedeltcheva A, et al. Reciprocal interactions between the GH axis and sleep. Growth Horm IGF Res 2004;14 Suppl A:S10–7. DOI
  20. 20 Van Cauter E, Leproult R, Kupfer DJ. Effects of gender and age on the levels and circadian rhythmicity of plasma cortisol. J Clin Endocrinol Metab 1996;81(7):2468–73. DOI
  21. 21 Duffy JF, Dijk DJ, Klerman EB, Czeisler CA. Later endogenous circadian temperature nadir relative to an earlier wake time in older people. Am J Physiol 1998;275(5 Pt 2):R1478–87. PubMed
  22. 22 Refinetti R, Menaker M. The circadian rhythm of body temperature. Physiol Behav 1992;51(3):613–37. DOI
  23. 23 Klerman EB, Gershengorn HB, Duffy JF, Kronauer RE. Comparisons of the variability of three markers of the human circadian pacemaker. J Biol Rhythms 2002;17(2):181–93. DOI
  24. 24 Douglas CM, Hesketh SJ, Esser KA. Time of day and muscle strength: a circadian output? Physiology 2021;36(1):44–51. PMC8425416
  25. 25 Morris CJ, Yang JN, Garcia JI, et al. Endogenous circadian system and circadian misalignment impact glucose tolerance via separate mechanisms in humans. PNAS 2015;112(17):E2225–34. PMC4418873
  26. 26 Narducci F, Bassotti G, Gaburri M, Morelli A. Twenty four hour manometric recording of colonic motor activity in healthy man. Gut 1987;28(1):17–25. PMC1432711
  27. 27 Scheer FA, Hu K, Evoniuk H, Kelly EE, Malhotra A, Hilton MF, Shea SA. Impact of the human circadian system, exercise, and their interaction on cardiovascular function. PNAS 2010;107(47):20541–6. PMC2996667