# Pattern Recognition in Older Adults' Activities of Daily Living
## 3 Materials and Methods
### Pattern Recognition
The complexity of Algorithm 1 is primarily determined by the pairwise comparison of beacons, which scales quadratically as \(O(b^{2})\), and the data processing step, which scales as \(O(n\times c\times r)\), where \(b\) is the number of beacons, \(n\) is the number of data points, \(c\) is the number of compartments, and \(r\) is the number of RSSI values per compartment. Future work may involve optimizing these two components. To reduce the pairwise beacon comparison complexity, beacons can be grouped into clusters based on logical proximity, and only beacons within the same cluster can be compared. Another possibility is to use hashing techniques like Locally Sensitive Hashing [28] to approximate string similarity \((s_{i},s_{j})\) instead of exact comparisons. To reduce the complexity of the data processing step, parallel processing can be used to process independent operations on different compartments \((c_{i})\) on time intervals \((t_{i})\). In conclusion, the combination of pattern recognition and outlier detection mechanisms enabled the correct interpretation of the information within the dataset. Various analyses identified and validated movement patterns, including accumulated data, percentiles, probability assessments, and outlier detection. This comprehensive approach ensured the accuracy and reliability of the results and provided valuable insights into the daily activities and behaviors of the individuals under study. Conceptualization, R.D. ; methodology, R.D. ; software, G.A. ; validation, C.C. and A.M.; formal analysis, A.M.; investigation, G.A. ; resources, R.D. ; data curation, G.A. ; writing--original draft preparation, G.A. ; writing--review and editing, R.D., C.C., and A.M.; visualization, G.A. ; supervision, R.D. ; project administration, R.D. ; funding acquisition, R.D. All authors have read and agreed to the published version of the manuscript. This work is funded by National Funds through the FCT--Foundation for Science and Technology, I.P., within the scope of the project Ref. UIDB/05583/2020. Furthermore, we thank the Research Centre in Digital Services (CISeD) and the Instituto Politecnico de Viseu for their support. Moreover, the authors greatly thank IPV/CGD--Instituto Politecnico de Viseu/Caixa Geral de Depositos Bank, within the scope of the projects PIDI/CISED/2022/007 and PIDI/CISED/2023/011. The datasets presented in this article are not readily available because the data are part of an ongoing study or due to technical limitations. Requests to access the datasets should be directed to [PERSON]. ### Conflicts of Interest:

The authors declare no conflicts of interest. ## Appendix A

This appendix relates to the definition of the functions that appear in Algorithm 1. * ReadData(file_name): Figure 10:4 Reads the data from a file specified by _file_name_ and returns the set of recorded data \(\mathcal{D}\). * RetrieveBeaconInfo(): Figure 10:5 Retrieves the set of all beacon information, returning \(\mathcal{B}\). * UUID(\(b_{i}\)): Figure 10:6 Figure 10:7 Figure 10:8 Maps the unique identifier (UUID) of a beacon \(b_{i}\) to its associated compartment \(c_{i}\in\mathcal{C}\). * Eq(\(s_{i},s_{j}\)): Figure 10:9 Calculates the percentage of equivalence between two compartment strings \(s_{i}\) and \(s_{j}\). * Concatenate(\(s_{i},s_{j}\)): Figure 9:0 Combines the strings \(s_{i}\) and \(s_{j}\) if they represent the same compartment. * GetSmaller(UUID(\(b_{j}\))): Figure 9:1 Selects the smallest UUID among the beacons \(b_{j}\) within a compartment \(c_{i}\), designating it as the \"master\" beacon. * RedirectData(\(b_{j}\), \(m\)): Figure 9:2 Redirects the data from beacon \(b_{j}\) to the \"master\" beacon \(m\). * Min(\(d_{i}\)): Figure 9:3 Identifies the earliest timestamp in the data \(d_{i}\). * Max(\(d_{i}\)): Figure 9:4 Identifies the latest timestamp in the data \(d_{i}\). * numDays(\(t_{\text{earliest}},t_{\text{latest}}\)): Figure 9:5 Computes the total number of days between \(t_{\text{earliest}}\) and \(t_{\text{latest}}\).