# Unsupervised Classification of Human Activity with Hidden Semi-Markov Models
## 3 Results
### Model Validation  
The model trained with magnitude acceleration only and with a very uninformative prior was chosen. The inferred parameters for the distributions characterising acceleration magnitude and state duration are shown in Table 6. The durations found ranged from 7.5 min for sleeping to 8 s for walking states, which are reasonable as sleep should be the longest activity and walking is often a transition activity. The Bland-Altman plots in Figure 3 show the agreement between the time spent in activities classified by [PERSON] et al. [7] and the states inferred by the HSMM for sleep, sedentary time and overall physical activity (calculated as the sum of walking, moderate activity and light tasks). On the contrary, there is a visible proportional bias for moderate activity, walking and light tasks, suggesting a poor agreement between the methods for these activities. Finally, the significance of the HSMM-inferred states was tested with a linear regression between physical behaviours and anthropometric measures. For this analysis, only the regression coefficients for \(z_{1}\) are reported, since the regression coefficient \(\beta_{1}\) for the first ILR coordinate \(z_{1}\) represents the strength of the association between the chosen activity and the outcome, while \(z_{1+i}\) cannot be interpreted in a meaningful way. The time spent in each activity was calculated for classified activities and HSMM-inferred states and was transformed with an isometric log-ratio transformation to express it as the time spend in a certain activity with respect to others. Given the poor correlation and agreement between moderate activity, light tasks and walking, only the overall physical activity was considered. From Table 7, it can be seen that there is a high agreement between the estimated regression coefficients and \(p\)-values, indicating that the HSMM is a viable method to infer activities from accelerometer data to uncover health-related associations. \begin{table}
\begin{tabular}{l r r r r} \hline \hline
**Activity** & **Magnitude** & **Magnitude + Axes** & **Axes** & **Magnitude + Angles** \\ \hline MPA & 0.11 [0.02–0.19] & 0.12 [0.03–0.21] & 0.23 [0.15–0.31] & \(-\)0.02 [\(-\)0.11–0.07] \\ Walking & 0.5 [0.43–0.57] & 0.49 [0.42–0.56] & \(-\)0.06 [\(-\)0.15–0.03] & 0.45 [0.38–0.52] \\ Light tasks & 0.11 [0.03–0.2] & 0.1 [0.01–0.18] & 0.13 [0.04–0.21] & 0.04 [\(-\)0.05–0.12] \\ SB & 0.22 [0.13–0.3] & 0.26 [0.18–0.34] & \(-\)0.04 [\(-\)0.13–0.05] & 0.18 [\(-\)0.05–0.12] \\ Sleep & 0.35 [0.27–0.42] & 0.22 [0.14–0.30] & \(-\)0.12 [\(-\)0.21—0.03] & 0.29 [0.21–0.37] \\ Overall PA & 0.59 [0.53–0.64] & 0.55 [0.48–0.61] & 0.03 [\(-\)0.06–0.12] & 0.48 [0.41–0.55] \\ Average (std) & 0.31 (0.2) & 0.29 (0.19) & 0.03 (0.13) & 0.09 (0.32) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Effect of different features on the correlation between time spent in activities as estimated by our unsupervised HSMM model and by the supervised model of [PERSON] et al. [7]. Data presented as Pearson’s correlation coefficients and 95% confidence intervals, unless otherwise stated. \begin{table}
\begin{tabular}{l r r r} \hline \hline
**Activity** & **Very Informative** & **Medium** & **Very Uninformative** \\ \hline MPA & 0.17 [0.08–0.25] & 0.11 [0.02–0.19] & 0.18 [0.1–0.2] \\ Walking & 0.35 [0.27–0.43] & 0.5 [0.43–0.57] & 0.28 [0.2–0.36] \\ Light tasks & 0.19 [0.10–0.27] & 0.11 [0.03–0.2] & 0.19 [0.1–0.27] \\ Sedentary & 0.37 [0.29–0.44] & 0.22 [0.13–0.3] & 0.48 [0.41–0.55] \\ Sleep & 0.34 [0.26–0.41] & 0.35 [0.27–0.42] & 0.39 [0.31–0.46] \\ Overall PA & 0.71 [0.67–0.75] & 0.59 [0.53–0.64] & 0.81 [0.31–0.84] \\ Average (std) & 0.36 (0.19) & 0.31 (0.2) & 0.39 (0.23) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Effect of activities durations prior on the correlation between time spent in activities as estimated by our unsupervised HSMM-based classification and by the supervised method of [PERSON] et al. [7]. Data presented as Pearson’s correlation coefficients and 95% confidence intervals, unless otherwise stated.