Skip to contents

actiRhythm gives you many functions, and several can look like they answer the same question. This guide points each question to the function that answers it, and distinguishes the methods that overlap. The rule throughout: start simple, and escalate only when the data demand it. The actogram and the nonparametric summary answer most questions on their own; the rest of the package is there for the recordings that are not so tidy.

Start here, every time

Plot the recording first with plot_actogram(), then run circadian.rhythm(), cosinor.analysis(), and rhythmicity.test() (or consensus.rhythmicity() for all of them at once). If the active band stacks into a straight vertical column and the numbers sit comfortably, you are done. Reach further only when the band bends, scatters, or fragments, or when a specific question below is yours.

Is there a rhythm, and how strong?

Two complementary answers:

Use the nonparametric route when you do not want to assume a sinusoid, and the cosinor route when you want interpretable parameters. They complement rather than compete: a high RA with a low IS, for instance, is a strong rhythm carried on irregular timing, something neither number says alone. To pool every test into one verdict, consensus.rhythmicity() runs the cosinor F-test, the Lomb-Scargle false-alarm probability, and the chi-square periodogram, and reports a majority vote and a Cauchy-combined p-value (Liu & Xie, 2020).

What is the period, and is it really 24 hours?

A cosinor assumes a fixed period (24 h by default). If the rhythm might run long or short (a free-running or drifting period), estimate it instead of assuming it:

Lomb-Scargle vs chi-square: prefer Lomb-Scargle when the recording has gaps or irregular epochs; the chi-square periodogram is the traditional choice for regularly sampled actigraphy. Running both and seeing the peak land in the same place is reassurance that it is real and not an artifact of one method. consensus.rhythmicity() uses both for exactly this reason.

How is the rhythm shaped?

In order of increasing waveform flexibility, choose the simplest the percent-rhythm says is enough:

The last two are demonstrated in the Beyond the basics article.

Does the rhythm drift, shift, or fragment?

When the actogram band bends or breaks up, a single summary averages the change away. Switch to the time-resolved tools:

These have their own walkthrough in the Nonstationary and complex rhythms article.

How complex or fractal is the signal?

Two recordings can share the same IS and amplitude yet differ in their moment-to-moment dynamics:

Demonstrated in Beyond the basics.

When does the person sleep, and how regular?

Which rest detector? sleep.changepoints() finds the one main rest bout of each night (sleep and wake timing). rest.periods() and rest.crespo() consolidate every rest bout across the recording, daytime naps included. Run both for an independent cross-check. rest.hmm() models rest probabilistically rather than as hard bouts.

Counts or raw acceleration?

  • You have count files (.agd) or pre-extracted counts: analyse them directly; everything above takes a count series.
  • You have raw files (.gt3x, .cwa, .bin): read.raw() and raw.metrics() give ENMO, MAD, and the z-angle, the gravity/posture signal counts cannot carry. The z-angle drives diary-free, posture-based sleep detection (rest.spt(), sib.vanhees()) that needs no scored sleep at all. See the From raw acceleration article.

Cross-brand counts (converting Axivity or GENEActiv to ActiGraph-equivalent counts) are an approximation (Brond et al., 2017): fine for the relative and normalised metrics here (IS, IV, RA, the periodograms, SRI), not for absolute-count comparisons or ActiGraph cut-points.

One subject or a group?

Every function above describes one recording. For a study:

  • Group mean rhythm: population.cosinor() pools per-subject cosinor fits into a Bingham population-mean rhythm with confidence intervals (Bingham et al., 1982).
  • Two-group comparison: cosinor.compare() tests whether the rhythm differs between groups (an omnibus Hotelling T^2 plus per-parameter tests) (Bingham et al., 1982).
  • Covariates, repeated measures, or nesting: run circadian.batch() over the folder to get one row of metrics per recording. Then feed those per-subject metrics (IS, IV, RA, MESOR, amplitude, acrophase, period) into a mixed model with lme4 or nlme alongside your design. The package supplies the metrics; you supply the multilevel model.

A quick map

Your question Reach for Walkthrough
Is there a rhythm, and how strong? circadian.rhythm, cosinor.analysis + rhythmicity.test, consensus.rhythmicity Getting started
What is the period? circadian.period, chi.sq.periodogram, period.ci Period and spectral analysis
What shape is the day? cosinor.extended, cosinor.multicomponent, circadian.flm Cosinor models
Does it drift or fragment? circadian.spectrogram, circadian.ssa, circadian.emd, sleep.changepoints Nonstationary and complex rhythms
How fractal/complex? fractal.dfa, mfdfa, multiscale.entropy Beyond the basics
When is sleep, how regular? sleep.cole.kripke/sleep.sadeh, sleep.regularity.index, rest.periods/rest.crespo Sleep and rest detection
Raw files, posture, diary-free sleep read.raw, raw.metrics, rest.spt + sib.vanhees From raw acceleration
A group, not one subject population.cosinor, cosinor.compare, then lme4/nlme Get started
What does column X mean? the metric tables Output codebook

Assumptions to respect

These hold across the package and decide whether any of the above is trustworthy:

References

Bingham, C., Arbogast, B., Cornelissen Guillaume, G., Lee, J. K., & Halberg, F. (1982). Inferential statistical methods for estimating and comparing cosinor parameters. Chronobiologia, 9(4), 397–439.
Brond, J. C., Andersen, L. B., & Arvidsson, D. (2017). Generating ActiGraph counts from raw acceleration recorded by an alternative monitor. Medicine & Science in Sports & Exercise, 49(11), 2351–2360. https://doi.org/10.1249/MSS.0000000000001344
Chen, S., & Sun, X. (2024). Validating CircaCP: A generic sleep-wake cycle detection algorithm for unlabelled actigraphy data. Royal Society Open Science, 11(5), 231468. https://doi.org/10.1098/rsos.231468
Cole, R. J., Kripke, D. F., Gruen, W., Mullaney, D. J., & Gillin, J. C. (1992). Automatic sleep/wake identification from wrist activity. Sleep, 15(5), 461–469. https://doi.org/10.1093/sleep/15.5.461
Cornelissen, G. (2014). Cosinor-based rhythmometry. Theoretical Biology and Medical Modelling, 11, 16. https://doi.org/10.1186/1742-4682-11-16
Costa, M., Goldberger, A. L., & Peng, C.-K. (2002). Multiscale entropy analysis of complex physiologic time series. Physical Review Letters, 89(6), 068102. https://doi.org/10.1103/PhysRevLett.89.068102
Crespo, C., Aboy, M., Fernandez, J. R., & Mojon, A. (2012). Automatic identification of activity-rest periods based on actigraphy. Medical & Biological Engineering & Computing, 50(4), 329–340. https://doi.org/10.1007/s11517-012-0875-y
Golyandina, N., & Zhigljavsky, A. (2013). Singular spectrum analysis for time series. Springer. https://doi.org/10.1007/978-3-642-34913-3
Huang, N. E., Shen, Z., Long, S. R., Wu, M. C., Shih, H. H., Zheng, Q., Yen, N. C., Tung, C. C., & Liu, H. H. (1998). The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. Proceedings of the Royal Society A, 454(1971), 903–995. https://doi.org/10.1098/rspa.1998.0193
Huang, Q., Cohen, D., Komarzynski, S., Li, X.-M., Innominato, P., Levi, F., & Finkenstadt, B. (2018). Hidden Markov models for monitoring circadian rhythmicity in telemetric activity data. Journal of the Royal Society Interface, 15(139), 20170885. https://doi.org/10.1098/rsif.2017.0885
Kantelhardt, J. W., Zschiegner, S. A., Koscielny-Bunde, E., Havlin, S., Bunde, A., & Stanley, H. E. (2002). Multifractal detrended fluctuation analysis of nonstationary time series. Physica A: Statistical Mechanics and Its Applications, 316(1-4), 87–114. https://doi.org/10.1016/S0378-4371(02)01383-3
Liu, Y., & Xie, J. (2020). Cauchy combination test: A powerful test with analytic p-value calculation under arbitrary dependency structures. Journal of the American Statistical Association, 115(529), 393–402. https://doi.org/10.1080/01621459.2018.1554485
Lomb, N. R. (1976). Least-squares frequency analysis of unequally spaced data. Astrophysics and Space Science, 39(2), 447–462. https://doi.org/10.1007/BF00648343
Marler, M. R., Gehrman, P., Martin, J. L., & Ancoli-Israel, S. (2006). The sigmoidally transformed cosine curve: A mathematical model for circadian rhythms with symmetric non-sinusoidal shapes. Statistics in Medicine, 25(22), 3893–3904. https://doi.org/10.1002/sim.2466
Nelson, W., Tong, Y. L., Lee, J. K., & Halberg, F. (1979). Methods for cosinor-rhythmometry. Chronobiologia, 6(4), 305–323.
Peng, C. K., Buldyrev, S. V., Havlin, S., Simons, M., Stanley, H. E., & Goldberger, A. L. (1994). Mosaic organization of DNA nucleotides. Physical Review E, 49(2), 1685–1689. https://doi.org/10.1103/PhysRevE.49.1685
Phillips, A. J. K., Clerx, W. M., O’Brien, C. S., Sano, A., Barger, L. K., Picard, R. W., Lockley, S. W., Klerman, E. B., & Czeisler, C. A. (2017). Irregular sleep/wake patterns are associated with poorer academic performance and delayed circadian and sleep/wake timing. Scientific Reports, 7(1), 3216. https://doi.org/10.1038/s41598-017-03171-4
Politis, D. N., & Romano, J. P. (1992). A circular block-resampling procedure for stationary data. In R. LePage & L. Billard (Eds.), Exploring the limits of bootstrap (pp. 263–270). Wiley.
Ramsay, J. O., & Silverman, B. W. (2005). Functional data analysis (2nd ed.). Springer. https://doi.org/10.1007/b98888
Roenneberg, T., Keller, L. K., Fischer, D., Matera, J. L., Vetter, C., & Winnebeck, E. C. (2015). Human activity and rest in situ. Methods in Enzymology, 552, 257–283. https://doi.org/10.1016/bs.mie.2014.11.028
Ruf, T. (1999). The Lomb-Scargle periodogram in biological rhythm research: Analysis of incomplete and unequally spaced time-series. Biological Rhythm Research, 30(2), 178–201. https://doi.org/10.1076/brhm.30.2.178.1422
Sadeh, A., Sharkey, K. M., & Carskadon, M. A. (1994). Activity-based sleep-wake identification: An empirical test of methodological issues. Sleep, 17(3), 201–207. https://doi.org/10.1093/sleep/17.3.201
Sokolove, P. G., & Bushell, W. N. (1978). The chi square periodogram: Its utility for analysis of circadian rhythms. Journal of Theoretical Biology, 72(1), 131–160. https://doi.org/10.1016/0022-5193(78)90022-X
Van Someren, E. J. W., Swaab, D. F., Colenda, C. C., Cohen, W., McCall, W. V., & Rosenquist, P. B. (1999). Bright light therapy: Improved sensitivity to its effects on rest-activity rhythms in Alzheimer patients by application of nonparametric methods. Chronobiology International, 16(4), 505–518. https://doi.org/10.3109/07420529908998724
Wang, J., Xian, H., Licis, A., Deych, E., Ding, J., McLeland, J., Toedebusch, C., Li, T., Duntley, S., & Shannon, W. (2011). Measuring the impact of apnea and obesity on circadian activity patterns using functional linear modeling of actigraphy data. Journal of Circadian Rhythms, 9, 11. https://doi.org/10.1186/1740-3391-9-11
Winnebeck, E. C., Fischer, D., Leise, T., & Roenneberg, T. (2018). Dynamics and ultradian structure of human sleep in real life. Current Biology, 28(1), 49–59. https://doi.org/10.1016/j.cub.2017.11.063
Witting, W., Kwa, I. H., Eikelenboom, P., Mirmiran, M., & Swaab, D. F. (1990). Alterations in the circadian rest-activity rhythm in aging and Alzheimer’s disease. Biological Psychiatry, 27(6), 563–572. https://doi.org/10.1016/0006-3223(90)90523-5
Wittmann, M., Dinich, J., Merrow, M., & Roenneberg, T. (2006). Social jetlag: Misalignment of biological and social time. Chronobiology International, 23(1-2), 497–509. https://doi.org/10.1080/07420520500545979