Cosinor Analysis of Biorhythm Data

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration models the 24-hour (circadian) variation of heart rate as a sinusoid with superimposed random noise. The methods of cosinor biorhythm analysis are used to estimate the magnitude, phase, and statistical significance of the modeled rhythm.


The cosinor method fits data to a cosine function, , where and are the mean and amplitude of the sinusoidal rhythm, is the period, and is the time of peak heart rate. In cosinor phraseology, the mean is called the mesor [1, 2, 3].

Plots are shown for the cosinor best-fit solution of and the bivariate error ellipse with amplitude and acrophase of 0.95 confidence intervals, which are dynamically computed and plotted on the polar graph.


Contributed by: Forrester A. Lee and Erik Mahieu (March 2014)
Open content licensed under CC BY-NC-SA



The cosinor 0.95 confidence error ellipse is centered at the tip of the amplitude-acrophase vector on the polar plot. The eccentricity and orientation (i.e., tilt) of the ellipse depend on the degree of nonuniformity in data collection, as occurs, for example, when data is missing or otherwise irregularly sampled. When the error ellipse overlaps the pole the amplitude estimate fails the test of significance (). This indicates the absence of a sinusoidal rhythm. In the case of pole overlap, amplitude and acrophase confidence intervals do not have calculable bounds [1].

Solving the nonlinear estimating function is straightforward after linearizing the parameters and applying least-squares techniques. Computing the amplitude and acrophase confidence intervals is more difficult, since efficient close-formed solutions do not exist. We therefore derive the relevant nonlinear implicit equations and apply Mathematica numerical root-finding techniques. This approach is efficient and permits dynamic updating of parameter values in the Demonstration.

The implicit equations defining amplitude and acrophase confidence limits are relevant to detection of circle-ellipse collisions and locating line-ellipse tangency points.


[1] W. Nelson, Y. L. Tong, J. K. Lee, and F. Halberg, "Methods for Cosinor-Rhythmometry," Chronobiologia, 6(4), 1979 pp. 305–323.

[2] R. Ferrara and A. Antonellini, "Using the SAS System for COSINOR Analysis of 24 Hour Ambulatory Blood Pressure Monitoring (ABPM) Data," in SAS European Users Group International Proceedings (SEUGI 1993), Jersey, Channel Islands: SAS Institute, 1993. the %20 SAS %20 System %20 for %20 COSINOR %20 Analysis %20 of %2024 %20 Hour %20 Ambulatory %20 Blood %20 Pressure %20 Monitoring %20 %28 ABPM %29 %20 Data.pdf.

[3] M. A. Rol de Lama, J. P. Lozano, V. Ortiz, F. J. Sánchez-Vázquez, and J. A. Madrid, "How to Engage Medical Students in Chronobiology: an Example on Autorhythmometry," Advances in Physiology Education, 29(3), 2005 pp. 160–64.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.