Calculation reference

Cosinor calculation manual

A concise reference for the model formulation, estimated parameters and statistical outputs used by Cosinor.Online.

Standard form Y = M + A × cos(2π × (t − φ) / T)
M MESOR A Amplitude φ Acrophase T Period

Model definition

Alternative forms of the cosinor model

The cosinor model can be written in two mathematically equivalent forms.

Standard form Y = M + A × cos(2π × (t − φ) / T)

M is MESOR, A is amplitude, φ is acrophase in hours and T is the period.

Linear regression form Y = MESOR + β·cos(ω·t) + γ·sin(ω·t)

Here ω = 2π / T, while β and γ are fitted using linear regression.

AmplitudeA = √(β² + γ²)
Acrophaseφ = atan2(γ, β)

The linear form enables direct estimation with linear models, including confidence intervals and statistical significance through the delta method and F-test.

Model scope

The reported estimates are valid for the fitted single-component cosinor model. Asymmetric waveforms or rhythms with multiple peaks within the user-selected period may be inadequately represented. In such cases, amplitude and acrophase describe the best-fitting sinusoid and may not correspond directly to the magnitude or timing of an observed peak. Inspect the raw observations and fitted curve, and consider multi-component cosinor, harmonic regression, or another complementary method when appropriate.

01

MESOR

The MESOR (Midline Estimating Statistic of Rhythm) is the baseline around which rhythmic variation occurs. It corresponds to the intercept in the fitted trigonometric model.

02

Amplitude

The amplitude quantifies the strength of the rhythmic component.

Amplitude = √(β² + γ²)

Its confidence interval is derived using the delta method.

03

Acrophase

The acrophase indicates the timing of the rhythm’s peak, first in radians:

Acrophase = atan2(γ, β)

It is then converted to hours and wrapped within the analysed period:

Acrophase (hours) = ((Acrophase × 180 / π) × period / 360) mod period
Interpretation guidance

CosinorOnline currently reports acrophase as a point estimate without a confidence interval. Acrophase is a circular parameter, so an uncertainty interval may cross the beginning and end of the analysed period. It also becomes poorly identified as amplitude approaches zero and should be interpreted cautiously when the overall rhythm is not statistically supported. Formal inference about phase differences requires a method that accounts for phase uncertainty and circularity.

04

F-statistic and p-value

The F-statistic tests whether both β and γ are significantly different from zero—that is, whether rhythmicity is present:

F = [(SStotal − SSresidual) / 2] / (SSresidual / (n − 3))

The p-value is derived through the regularized incomplete beta function, which approximates the tail of the F-distribution.

05

Confidence intervals

Confidence intervals (95%) for MESOR, β and γ are computed as:

CI = estimate ± tcrit · SE

We use tcrit based on degrees of freedom (n − 3). If df ≥ 30, a fixed tcrit ≈ 2.042 is used.

The amplitude CI uses the delta method with standard error derived from β and γ, without including their covariance term.

Interpretation guidance

Results may differ slightly from tools that do not rely on a linear regression fit. Differences may also arise from error propagation choices and numerical precision. The shaded band around the fitted curve reflects the confidence interval of the amplitude, not uncertainty of individual measurements.

06

Goodness of fit

expresses the proportion of explained variance:

R² = 1 − (SSresidual / SStotal)

R is the Pearson correlation between fitted and observed values.

07

Percent rhythm

Percent rhythm expresses rhythmic strength as:

Percent Rhythm = R² × 100

It matches the definition used in cosinor2 and other chronobiological tools.

08

Implementation note

Computations are implemented in PHP using matrix algebra, matrix inversion and an approximation of the incomplete beta function for statistical tests. Confidence intervals are calculated to eight decimal places based on standard regression theory.

09

GLS periodogram

The Generalized Lomb-Scargle periodogram is provided as an exploratory tool for identifying candidate periodicities in regularly or irregularly sampled data.

Interpretation guidance

The strongest peak is not necessarily the fundamental biological period and may instead reflect a harmonic, a long-term trend, the sampling pattern, aliasing, or limited recording duration. Reliable interpretation generally requires observations spanning several cycles and consideration of biological plausibility. CosinorOnline does not automatically select a period from the periodogram, and false-alarm probabilities or other formal significance measures for individual peaks are not provided. Users should therefore interpret peaks descriptively and, if appropriate, repeat the cosinor analysis using a biologically justified candidate period.

10

Multiple datasets and statistical inference

Each dataset is fitted and tested independently. Displayed p-values assess rhythmicity within individual datasets and are not adjusted for multiple testing. The comparison view provides a descriptive comparison of fitted parameters and plots; it does not test differences between datasets or provide group-level inference.

When analysing a family of multiple time series, apply an appropriate multiple-testing correction in suitable statistical software. Biological or technical replicates, longitudinal observations, and other grouped data require methods that account for their dependence or repeated structure.