Skip to main content

Data from: Ecological and social pressures interfere with homeostatic sleep regulation in the wild

Cite this dataset

Loftus, J. Carter; Harel, Roi; Nuñez, Chase; Crofoot, Margaret (2022). Data from: Ecological and social pressures interfere with homeostatic sleep regulation in the wild [Dataset]. Dryad.


Sleep is fundamental to the health and fitness of all animals. The physiological importance of sleep is underscored by the central role of homeostasis in determining sleep investment – following periods of sleep deprivation, individuals experience longer and more intense sleep bouts. Yet, most sleep research has been conducted in highly controlled settings, removed from evolutionarily-relevant contexts that may hinder the maintenance of sleep homeostasis. Using tri-axial accelerometry and GPS to track the sleep patterns of a group of wild baboons (Papio anubis), we found that ecological and social pressures indeed interfere with homeostatic sleep regulation. Baboons sacrificed time spent sleeping when in less familiar locations and when sleeping in proximity to more group-mates, regardless of how long they had slept the prior night or how much they had physically exerted themselves the preceding day. Further, they did not appear to compensate for lost sleep via more intense sleep bouts. We found that the collective dynamics characteristic of social animal groups persist into the sleep period, as baboons exhibited synchronized patterns of waking throughout the night, particularly with nearby group-mates. Thus, for animals whose fitness depends critically on avoiding predation and developing social relationships, maintaining sleep homeostasis may be only secondary to remaining vigilant when sleeping in risky habitats and interacting with group-mates during the night. Our results highlight the importance of studying sleep in ecologically relevant contexts, where the adaptive function of sleep patterns directly reflects the complex trade-offs that have guided its evolution.


Sleep location characterization and fidelity

Visualization of the GPS data indicated that individuals remained reliably stationary until at least 06:15 every day, and thus we determined the location in which each baboon slept from the median of the first 10 GPS locations that occurred before 06:15. If an individual’s GPS collar did not successfully collect 10 locations before 06:15, its data on this day were excluded from analyses involving sleep location. This resulted in the removal of 9/483 baboon-days of data. In ArcGIS, drone imagery was used to trace the crowns of distinct sleep trees within the group’s main sleep site. We determined that an individual slept in a particular tree if its sleep location was within the traced polygon of that tree crown. Sleep locations that fell outside the crown of a tree, likely reflecting minor error in the GPS location estimates, were assigned to the closest sleeping tree. Only 32/469 sleep locations (6.8%) had to be assigned to a sleep tree in this manner. In rare cases where an individual’s sleep location was greater than 10 m from the crown of the closest sleep tree (5/474 cases – 1.1% of baboon-days), its data on this day were excluded from analysis.

The following files in this Dyad dataset resulted from the tracing of the tree crowns in ArcGIS: "sleep_trees.cpg", "sleep_trees.dbf", "sleep_trees.prj", "sleep_trees.shp", "sleep_trees.shx"

Physical activity

We also calculated cumulative activity during the day from the accelerometry data. Using the continuous 12 Hz accelerometry data, we calculated VeDBA from 06:00 to 18:00 using a 0.5 second time window, averaged VeDBA over each minute, and then summed these values to generate a cumulative measure of activity during the day.

The average VeDBA per minute produced by this method is stored in this dataset in the file: "vedba_mean_2012.csv"

Environmental data

The minimum ambient temperature represented the minimum temperature at the sleep site during the night, determined using interpolated ECMWF air temperature (2 m above ground) data obtained with the Env-DATA functionality (Dodge et al., 2013) provided on Movebank data repository (

The file containing the ambient temperatures that was produced by the Env-DATA functionality in Movebank can be found in this Dryad dataset: "env_data.csv-6150899038464587825.csv"

Sleep validation study

To evaluate whether the accelerometer-based sleep classification technique was accurately monitoring sleep in baboons, we returned to Mpala Research Centre in July 2019 to perform a validation study in which we compared the results of the accelerometer-based sleep classification to direct observations of awake and sleeping baboons. Using the procedures described in Strandburg-Peshkin et al., 2015, we trapped and anesthetized 27 members of a group of habituated olive baboons, fitting each with a GPS and accelerometry collar. Eleven of the 27 collars deployed recorded continuous tri-axial accelerations at 12 Hz/axis from 06:30 to 18:00 and 0.71-second bursts of accelerations at 56.2 Hz/axis at the beginning of every minute from 18:00 to 06:30. Accelerometry data was collected by each of these 11 collars for up to 31 days. The remaining 16 collars did not collect accelerometry data from 06:30 to 18:00, and thus we excluded data from these collars from the validation study.

We down-sampled and interpolated the accelerometry data such that it matched the sampling frequency and schedule of the data collected in 2012 (i.e. the data analyzed for this manuscript). We then applied the sleep classification algorithm described in the Materials and Methods to this validation dataset.

To validate the sleep classification algorithm, we performed direct behavioral observations of the baboons at their primary sleep site. We recorded the behavior of the study baboons starting when they approached their sleep site using a FLIR T1020 high-resolution infrared camera (FLIR Systems Inc., Wilsonville, OR, USA). Recordings continued into the night for as long as the camera battery allowed (average recording duration (range of recording durations): 7.4 hours (1.7 – 14.9 hours)), and we collected thermal imaging data on 21 nights. We identified individuals in the thermal imagery both in real-time, via observer narration of the recorded imagery, and post-recording, by matching movements of individuals in the thermal imagery to the GPS tracks of collared individuals.

Following initial data collection, we used the commercial software Loopy (Loopbio GmbH, Austria) to score the behavior of identified individuals in the thermal imagery. Individuals’ behavior was scored as “wakefulness”, “resting wakefulness”, or “sleep”. Wakefulness refers to any behavior involving active movement (i.e. walking, running) or engaged activity (i.e. allogrooming), whereas resting wakefulness refers to behaviors that are dormant (i.e. sitting), but not in the typical sleeping posture of a baboon (sitting or lying with neck relaxed and head hung). Sustained dormant behavior in the typical sleep posture was considered sleep. Video scoring resulted in a total of 8.0 hours of behavioral observation across a total of 16 individual baboons.

Synchronizing the thermal imagery data with the accelerometry data produced a validation dataset of 294 minute-epochs across six baboons that were both classified as either sleep or wakeful behavior from accelerometry, and scored as wakefulness, resting wakefulness, or sleep from direct observation. With both wakefulness and resting wakefulness representing wakeful behavior, the accelerometer-based sleep classification exhibited an accuracy of 79.9% (Table S12). Consistent with previous validation studies of the use of accelerometry in measuring sleep (Ancoli-Israel et al., 2003; de Souza et al., 2003), we found that accelerometer-based sleep classification has difficulty distinguishing resting wakefulness from sleep, and we consider this limitation in our interpretation of the results.

The accelerometry data and the behavioral observation data used for this validation study correspond to the following files in this dataset, respectively: "2019_Papio_anubis_acc_Loftus_et_al_Dryad.csv", "2019_Papio_anubis_behavioral_scoring_Loftus_et_al_Dryad.csv"

Usage notes

There is a 16 second delay between the timestamps of the accelerometry and the timestamps of the behavioral scoring data. This 16 second delay is typical of GPS clocks. Thus, to synchronize the timestamps in the accelerometry and behavioral scoring datasets, 16 seconds must be added to the timestamps of the behavioral scoring.

The GitHub repository (CarterLoftus/baboon_sleep) archived in the Zenodo link in this Dryad repository contains a file that provides detailed instructions on how to replicate the final results of this study using the data available in this Dyrad repository and on Movebank (


National Science Foundation, Award: IIS 1514174

National Science Foundation, Award: IOS 1250895

David and Lucile Packard Foundation, Award: 2016-65130

Deutsche Forschungsgemeinschaft, Award: 422037984