## 2 Materials and Methods
### Experimental Framework  
Figure 1a sequentially illustrates the flow of data collection and the method of data analysis in the study. In the experimental framework, a single tri-axial G-sensor with a sampling rate of 50 Hz was first adhered to a subject's chest as shown in Figure 1b and used to detect every change in human posture. Three common postures in daily life are sequentially shown in Figure 1c-e. The characteristic length and weight of the employed G-sensor is about 4 cm and 7 g, respectively. Thus, the employed sensor is suitable for the applications of wearable sensing and personal health care as mentioned. Then, a wireless communication protocol using the technique of radio frequency data buffer (RFDB) associated with Bluetooth 4.0, Xenon [53; 54], was adopted for the long-term experiments. Eventually, all well-collected data would be automatically uploaded to a personal cloud database or a portable device for further customized posture analysis. The procedure of algorithmic execution is illustrated in Figure 2. The analog datasets acquired by the G-sensor in each sensing axis will be mapped into their corresponding 2D Cartesian space in a matter of axis-to-axis. Then, each set of the 2D mapped data points will be sequentially fed into the algorithm to estimate the cluster number \(i\) as shown in Step (1). As illustrated in the algorithmic flow, the initial cluster number is set to be one and the initial number will be continuously updated until reaching the stop conditions (see Step (7)). While the cluster number is given, the data PDF in the 2D space will be estimated using any sophisticated machine learning estimator in Step (2). In this case, the Gaussian mixture model (GMM) [55; 56; 57] was adopted for the following algorithmic estimations. Then, the corresponding KEDF and PEDF can be estimated using Equations (3) and (4), respectively, in Step (3). When \(i\geq 2\), as shown in the algorithmic flow, these density functionals become linear combinations of measurements contributed from \(i\) clusters. After each estimation of density functionals, the adaptive scaling factor listed in Equation (8) will then be calculated to avoid the issues of scaling deformation occurring in the data mapping procedure (see Step (4)). Therefore, in Step (5), the HDF and the LDF respectively listed in Equations (6) and (7) can be estimated accordingly. It should be emphasized that the proposed DDFM algorithm provides an avenue to estimate the most probable cluster number in a studying system [41]. Based on the concept of energy stability in physics, the most probable cluster number can be estimated by measuring the turning point in the trend curves of the global Hamiltonian functional (HF). The theoretical form of the global Hamiltonian functional is shown in Step (6). Meanwhile, the DDFM algorithm also provides the stop conditions to automatically terminate the estimation process. As listed in Step (7) of Figure 2, two stop conditions were used in the DDFM algorithm. Generally, the whole estimation process will be terminated when the global Hamiltonian functional reaches a stable value. Additionally, the ill-conditioned PDF estimation was also employed for the termination of estimation to avoid the over-estimation of cluster number. At this stage, the most probable cluster number can be defined and the most probable value is \(i-1\), as shown in Step (8). Eventually, the corresponding cluster boundaries can be delineated by  
Figure 1: The procedure of data collection is shown in (**a**). The changes in human posture will be detected using the tri-axial gravitational sensor and the collected data will then be transmitted to a personal cloud database. The longest dimension of the sensor is about 4 cm and its weight is about 7 g. (**b**) Shows the related location of the sensor that was directly adhered on a subject’s chest. The directions of sensing axes of the G-sensor were also depicted in each photo of various postures.