## 6 Sensor Data Acquisition and Collection
### Sensor Data Collection by HMM  
Another part of the service (shown in Figure 1) is the support for sensor data collection, responsible for the encoding of measured socket operational conditions. Since the physical intra-socket dynamic conditions can only be estimated by the outputs of sensors, we use HMM [66] to build a Bayesian network that integrates the probabilistic models of Equations (1) and (2) for the inference of likely intra-socket dynamic conditions. The inference is conducted as a well-structured form of BI, where possible pressure load conditions are inferred based on the probabilistic characteristics of pressure observation and process dynamics. The outcome typically includes the estimations of likely states and state paths, which constitute the basis for further operational condition analysis, such as classification or prediction. Essentially, a HMM model defines a discrete-time stochastic dynamic process with a sequence of finite operational states with associated probabilistic observations by sensing. The model is usually displayed as a directed graph of Bayesian network as shown in Figure 7, defined by the following 5-tuple of parameters:  
\[\textbf{Hidden Markov Model}:\Theta=(Z,X,A,B,\Pi) \tag{4}\]  
where, \(Z\) is a sequence of hidden or latent states of random variables due to the state transition in the dynamic process of socket operation. For a time interval with \(T\) discrete instances, it is given as \((Z_{0},Z_{1},\ldots,Z_{T})\) for the latent states at the discrete time instances \(t\). is a sequence of \(T\) observations of the latent states by sensor in the form of \((X_{1},X_{2},\ldots,X_{T})\) for the observations at the time instances of \(t\) during \(T\). Each latent state \(Z_{t}\) has its condition defined by some random variables, which correspond to the intra-socket pressure load. We discretize the pressure load into a set of \(N\) discrete hidden states \(S=\{S_{1},S_{2},\ldots,S_{N}\}\) and let the condition of \(Z_{t}\) be given according to the state variable \(S\). Similarly, we consider there are \(M\) possible values of the obviation with \(\{V_{1},V_{2},\ldots,V_{M}\}\). \(\Pi\) denotes the initial probability distribution of \((Z_{0},Z_{1},\ldots,Z_{T})\) regarding the \(N\) latent states. The progress of dynamic process (i.e., the edges in Figure 7) is captured by \(A\) and \(B\). \(A\) defines the probabilities of state transition \(P(Z_{t}|Z_{t-1})\) (Equation (2)), given as a stochastic matrix for the state transition model with elements \(\{a_{11},a_{12},\ldots,a_{NN}\}\). From every latent state \(i\), each \(a_{in}\) represents the probability of reaching another state j, with \(\sum_{n=1}^{N}a_{in}=1\). \(B\) defines probabilities of state observation \(P(X_{t}|Z_{t})\) (Equation (1)), given as a stochastic matrix with elements \(\{b_{11},b_{12},\ldots,b_{NM}\}\). From every latent state \(i\), each \(b_{in}\) represents the probability of reaching an observation \(m\), with \(\sum_{m=1}^{M}b_{in}=1\). HMM has its parameters trained with data. In particular, the states are defined by a discretization of the physical properties of concern. For example, the intra-socket pressure load 0-100 kPa can be divided evenly into \(N\) discrete states with \(S=\{S_{1},S_{2},\ldots,S_{N}\}\). We refer the measurement data as \(\mathcal{D}\), given as the observation sequence \(X_{1..T}\) for re-scaled logic time intervals \(T\). For probabilistic execution progress description, we denote one probabilistic path of execution progress through \(T\) with \(\xi^{T^{*}}\) and the most likely path of execution progress with \(\xi^{T^{*}}\). The most likely states at each time instance \(t\) in \(T\) in such paths are denoted with \(\xi^{T}_{t}\) and \(\xi^{T^{*}}_{t}\).