Smartphone use as sleep-wake cycle. Integrating multimodal data. Nonparametric circadian analysis.

Jeff Brozena

- Answer: How is our data useful as actigraphy? “Tappigraphy” as metaphor
- Integrating multimodal data streams via burstiness and memory
- Clearly define nonparametric circadian measures
- Conclude with Jupyter notebook review

- This study offers tappigraphy as a clear complement and reflection to actigraphy in sleep measurements
- "We deployed a simplistic algorithm to determine the putative sleep onset and wake-up times based on the smartphone touches. This tappigraphy algorithm essentially combined two safe assumptions.
- the smartphone screen can be only touched when awake.
- this provided a list of smartphone usage gaps of which at least one contained sleep duration

- users follow a 24-h sleep–wake cycle.
- This helped select the maximum gap which overlapped with the inactive phase—and this gap was identified as putative sleep."
^{1} - This simple approach resulted in sleep-onset times and wake-up times, which were highly correlated with the times extracted from the standard actigraphy or sleep diary

- This helped select the maximum gap which overlapped with the inactive phase—and this gap was identified as putative sleep."
- Codebase is here

- the smartphone screen can be only touched when awake.

- “Interestingly, the sleep durations were typically shorter when measured by using tappigraphy in comparison with actigraphy or sleep diaries”
- Actigraphy picks up on stillness in bed where tappigraphy picks up on activity

- Introduces four techniques to analyze high-density multimodal behavioral data
- visualizing raw time series
- describe distribution of time series (burstiness)
- Chromatic and Anisotropic Cross-Recurrence Quantification Analysis** (CRQA)
- Granger Causality

- I’ll focus on
**burstiness**as one possible framework to analyze multimodal data across time

- “Conventional statistical methods assume that variations in behavioral time series data are stationary across time, but this is lost in complex environments and results are lost in averaging process”
- “We need methods that can reveal non-linear changes in human behaviors across temporal scales”
- “There are few domain-specific analytical tools that can characterize high-density multimodal dynamics of human activities…”

- “a method to quantify temporal regularity of occurrence of events”
^{4}- “Can be useful for psychologists studying the temporal patterns of behavior”, first introduced in statistical physics

- “The analysis requires the user to have a
**binary spike train**of 0s and 1s in which a 1 represents the onset of an event of interest and 0 represents instances when an onset did not occur.”^{4}- “Let us consider a system whose components have a measurable activity pattern that can be mapped into a discrete signal, recording the moments when some events take place, like an email being sent…”
^{2}

- “Let us consider a system whose components have a measurable activity pattern that can be mapped into a discrete signal, recording the moments when some events take place, like an email being sent…”
- Does this describe our data?

- Distribution of events measured across time series
- burstiness parameter
**B**is defined as bounded range of (-1, 1), where 1 is most bursty signal, -1 is completely regular (periodic) signal across a time distribution

- burstiness parameter
- Interevent correlation-based measure
- memory parameter
**M**is correlation coefficient of consecutive interevent time values- memory coefficient has bounded range (-1, 1) where -1 has negative memory effects and 1 has positive memory effects
- see this for clear definition of above

- memory coefficient has bounded range (-1, 1) where -1 has negative memory effects and 1 has positive memory effects

- memory parameter
- Goh and Barabási
^{2}describe the relationship between these in depth, but it is beyond the scope of this presentation

- Describes clustering of events in a time series
- Allows “researcher the ability to provide a simple index of temporal structure of behaviors of interest”
^{4}**Can we use this sort of index as a method of calculating anomaly across multiple data streams across time?**

- The rest-activity rhythm is a biological rhythm that does notfollow a sinusoidal waveform. For this reason other variables have been proposed to describe this rhythm more adequately.
- Since some variables generated by these methods are not related to the parameters obtained by adjustment to the cosine function, they are referred to as nonparametric functions.
- These variables include:
- intradaily variability (IV)
- interdaily stability (IS)
- the least active five-hour period (L5) and the most active ten-hour period (M10)

- In contrast to cosinor, this methodology does not follow the assumption that the rest-activity rhythm behaves similarly to a sinusoidal wave.
^{3}

- “Although algorithms for assessing sleep from actimetry data exist, it is useful to analyze the rest-activity rhythm using nonparametric methods. This would then allow rest-activity rhythm stability, fragmentation and amplitude to be quantified. In addition, sleep and wakefulness efficiency can be quantified separately.”
**“Patients with bipolar disorder had a less stable (smaller IS) and more fragmented (larger IV) rest-activity rhythm than subjects from a control group”**^{3}

- via pyActigraphy’s metrics.py
Average daily total activity

`def _average_daily_total_activity(data): return data.resample('1D').sum().mean()`

Interdaily stability

`def _interdaily_stability(data): r"""Calculate the interdaily stability""" d_24h = data.groupby([ data.index.hour, data.index.minute, data.index.second] ).mean().var() d_1h = data.var() return (d_24h / d_1h)`

Intradaily variability

`def _intradaily_variability(data): r"""Calculate the intradaily variability""" c_1h = data.diff(1).pow(2).mean() d_1h = data.var() return (c_1h / d_1h)`

- Locally hosted here

- Borger, J. N., Huber, R., & Ghosh, A. (2019). Capturing sleep–wake cycles by using day-to-day smartphone touchscreen interactions. Npj Digital Medicine, 2(1), 1–8. https://doi.org/10.1038/s41746-019-0147-4
- Matlab code is here

- Goh, K.-I., & Barabási, A.-L. (2008). Burstiness and memory in complex systems. EPL (Europhysics Letters), 81(4), 48002. https://doi.org/10.1209/0295-5075/81/48002
- Gonçalves, B., Adamowicz, T., Louzada, F. M., Moreno, C. R., & Araujo, J. F. (2015). A fresh look at the use of nonparametric analysis in actimetry. Sleep Medicine Reviews, 20, 84–91. https://doi.org/10.1016/j.smrv.2014.06.002
- Xu, T. L., de Barbaro, K., Abney, D., & Cox, R. (2019). Finding Structure in Time: Visualizing and Analyzing Behavioral Time Series [Preprint]. PsyArXiv. https://doi.org/10.31234/osf.io/mpz9g
- Matlab code is here