Picture of the smartphone and PSG device placement (a) and representation of the smartphone placement (b) including the direction of the accelerometry X axis (red), Y axis (yellow) and Z axis (green) as well as the X-Z plane, where the sleep angle is calculated, and the Y-Z plane, where the stand angle is calculated. Explanation of the rules used to discretize the sleep angle (c) and stand angle (d). The sleep angle was classified into the four sleep positions: supine, prone, left and right. The stand angle into two categories: standing (either stand or headstand) and lying. The stand category also had a second constraint (3).