## 2 Materials and Methods
### Calculating Periodicity Intensity Using Time-Lagged Overlapping Windows
Instead, we focus on 24-h circadian periods because previous studies indicate that circadian periodicity carries most of the energy in the longitudinal accelerometer data [15]. Likewise, we do not map the time series data into another space, such as an embedded space, as has been performed in [16] with protein sequences. Discrete wavelet transforms [17] can be used with time series data for noise filtering and data reduction, and specifically for detecting singularities such as outliers [18], but this is different to our use case where we are looking to identify long-term behaviour changes. Hilbert transforms (empirical mode decomposition) [19] are often used with time series for gathering information about frequency characteristics, such as amplitude and phase, but not long-term shifts in time series characteristics. The zero crossing rate (ZCR) [20] is used extensively in speech and music audio processing and corresponds to the rate at which a signal transitions from positive to negative or negative to positive, while historical volatility [21] is a statistical measure from economics and finance measuring the degree of variation of adjacent values in a time series. Each of these latter forms of analysis measures the dynamic changes in a time series but does not give the longitudinal changes in 24-h periodicity intensity, which our measure does. These signal processing techniques are used in a wide variety of applications, such as data augmentation to support deep learning [22] and in [23] where time, frequency and spectral power domain feature vectors are derived from vibration and acoustic emissions from bearings in machinery in order to detect faults. Empirical Mode Decomposition (EMD) is a technique used to decompose a signal into useful components similar to analysis methods, such as Fourier transforms and wavelets, and it is particularly useful in exploratory analyses of data. The principle behind EMD is to split an original time series into a set of smooth curves or intrinsic mode functions. In the case of fault diagnosis, it is typically used to decompose a vibration signal into components used to train classifiers, usually with high accuracy. However, EMD is known to be sensitive to noise as well as requiring a manual selection of parameters [24] to support its exploratory nature. Zerocross Density Decomposition (ZCD) is a more recently developed technique [25] that is based on the concept of zero-crossings and is computationally more efficient than EMD. However, EMD is more effective than DD in terms of accuracy and robustness when dealing with non-stationary signals [26]. Our algorithm does not split a time series into constituents as EMD or ZCD do, and our method is less sensitive to noise because we use the Lomb-Scargle periodogram [13] to calculate periodicity, an algorithm that tolerates irregular sampling and missing data. Algorithm 1 demonstrates the method to compute periodicity intensity. We assume we already know the optimal window size \(m\), stride length \(l\) and the frequency \(Fo\) that we have identified and are interested in. In this case, for studies in this paper, \(Fo\) can either be circadian (24-h) or weekly periodicity. \(X_{w}\) is the windowed input data, and \(S_{f}\) is the periodogram computed with Fast Fourier Transform. IntensityFunc computes intensity by taking the periodogram of a windowed/local time series data and one focused frequency, \(Fo\). We aggregate energy carried by all close frequencies that are around \(Fo\) in the case of energy leakage. ```
Input : A time series data \(x_{n}\in X\) Where \(n=1,2,3\ldots N\) with \(N\) data points. Optimal window size \(m\) and stride length \(l\). \(Fo\in\{\frac{1}{24l},\frac{1}{168l}\}\) Output : A time series data \(y_{t}\in Y\) where \(t=1,2,3,\ldots\lfloor\frac{N-m+1}{l}\rfloor\).