Fits \(C(t) = m + a \cos\{2\pi (t - \phi)/P\}\) with period \(P = 1440\) minutes to a rescaled activity series. Returns fitted curve, binary curve after thresholding, and canonicalized parameters (non-negative amplitude). MESOR (mesor) The baseline or “midline” level around which the rhythm oscillates. Units = same as actigraphy your data Roughly the average activity across the cycle.
sleep_cos(clean_df, thr = 0.2)A list with elements:
fitted cosine curve.
dichotimized cosine curve
c(Mesor, Amplitude, Acrophase).
Root mean squared error between fitted cosine curve and data.
cleaned dataframe with cleaned_df$Activity.
Dichotomization threshold for fitted curve.
Amplitude (amp) Half the peak-to-trough swing of the fitted rhythm. Units is the same as actigraphy data. Larger amplitude → stronger rhythmicity (bigger day–night contrast). Negative amp will be flipped, and P/2 will be added to phase. Acrophase (phase) The timing of the peak of the fitted cosine. Units is the epoch units of the data (e.g. minutes). P=1440, interpret phase as minutes-of-day relative to your x origin.
screen_wear(), sleep_detection(), extract_sleep_metrics()