Explanation of Cosinor Model Parameters

Alternative Forms of the Cosinor Model

The Cosinor model can be written in two mathematically equivalent forms:

  • Standard form (intuitive):
    Y = M + A × cos(2π × (t – φ) / T)
    where M is the mesor, A is amplitude, φ is acrophase (in hours), and T is the period.
  • Linear regression form (used in our implementation):
    Y = Mesor + β·cos(ω·t) + γ·sin(ω·t)
    where ω = 2π / T, and β and γ are fitted using linear regression. From these, we compute:
    • Amplitude: A = √(β² + γ²)
    • Acrophase: φ = atan2(γ, β)

The linear form allows direct estimation using linear models and enables calculation of confidence intervals and statistical significance via 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.
1. 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.


2. Amplitude

The Amplitude quantifies the strength of the rhythmic component:

Amplitude = √(β² + γ²)

Its confidence interval is derived using the delta method.


3. Acrophase

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

Acrophase = atan2(γ, β)

Then converted to hours (wrapped within 0–24h):

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.

4. F-statistic and p-value

The F-statistic tests whether both β and γ are significantly different from zero (i.e., whether rhythmicity is present):

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

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


5. 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, we use a fixed tcrit ≈ 2.042.

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

Note: Results may differ slightly from other tools (e.g., cosinor2) only when those tools do not rely on a linear regression fit. All intervals in this application are derived from the underlying linear regression model. Differences may also arise from variations in error propagation (e.g., omission of the β–γ covariance term) and numerical precision.

The shaded confidence band around the fitted curve in the plot reflects the CI of the amplitude, not the CI of individual observed values. This representation shows the uncertainty of the modelled rhythm, not of individual measurements.


6. Goodness of Fit

expresses the proportion of explained variance:

R² = 1 − (SSresidual / SStotal)

R is the Pearson correlation between fitted and observed values.


7. Percent Rhythm

The Percent Rhythm expresses rhythmic strength as:

Percent Rhythm = R² × 100

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


8. Implementation Note

All computations are implemented in PHP, using matrix algebra, inverse, and an approximation of the incomplete beta function for statistical tests. Confidence intervals are precise to 8 decimal places, based on standard regression theory.

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