## 3 Temperature Sensor Clustering Method
### Establishment of the Distance Matrix  
The indicator proposed above can be expressed in the form of the distance matrix. Firstly, the distance matrix that represents the gap between the values of the temperature sensors is derived. The temperature value of all temperature sensors can be represent by a matrix \(\mathbf{X}^{m\times n}\):  
\[\mathbf{X}=\left[ \begin{array}{cccc}\mathbf{x_{1}}&\mathbf{x_{2}}&\cdots&\mathbf{x_{n}}\\ \end{array} \right] \tag{1}\]  
where \(\mathbf{x_{i}}\) (\(i=1\sim n\)) is the measured temperature sequence of the \(i\)th temperature sensor, which has \(m\) elements:  
\[\mathbf{x_{i}}=\left[ \begin{array}{cccc}x_{i1}&x_{i2}&\cdots&x_{im}\\ \end{array} \right]^{T} \tag{2}\]  
in which each element is a temperature value, representing the temperature at a certain moment. For example, \(x_{ij}\) (\(j=1\sim m\)) is the temperature value of the \(i\)th temperature sensor at the \(j\)th sampling time. The distance matrix is expressed in the form of Equation (3):  
\[\mathbf{D}=\left[ \begin{array}{cccccc}0&d_{12}&\cdots&d_{1q}&\cdots&d_{1n}\\ d_{21}&0&\cdots&d_{2q}&\cdots&d_{2n}\\ \vdots&\vdots&\ddots&\vdots&\cdots&\vdots\\ d_{p1}&d_{p2}&\cdots&\ddots&\cdots&\vdots\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ d_{n1}&d_{n2}&\cdots&\cdots&\cdots&0\\ \end{array} \right] \tag{3}\]  
\(\mathbf{D}\) is a \(n\times n\) symmetric matrix and its diagonal elements are all zero. It reflects the distance between every two temperature sensors of the total \(n\) temperature sensors. For example, \(d_{pq}\) is the distance between the \(p\)th temperature sensor and the \(q\)th temperature sensor. When considering the gap between the value of the temperature sensors, \(d_{pq}\) can be expressed by the Euclidean distance. Euclidean distance is a type of geometrical distance between vectors in \(m\) dimensional space when  
Figure 3: Temperature sensors with different characteristics. considering the measured temperature sequences (\(\mathbf{x_{i}}\)) of every temperature sensor as \(m\) dimension vectors. As for the \(p\)th temperature sensor \(\mathbf{x_{p}}\) and the \(q\)th temperature sensor \(\mathbf{x_{q}}\), it is expressed as:  
\[d_{pq}=\sqrt{\big{(}\mathbf{x_{p}}-\mathbf{x_{q}}\big{)}^{T}\big{(}\mathbf{x_{p}}-\mathbf{x_{q}} \big{)}}\ (\ p=1\ \sim\ n,\ q=1\ \sim n) \tag{4}\]  
Thus, each element of the matrix can be derived according to Equation (4). Then, for further calculation, the element of the matrix is normalized to \([0,\ 1]\) by the following process:  
\[d_{pq}^{e}=\frac{d_{pq}-d_{\min}}{d_{\max}-d_{\min}} \tag{5}\]  
in which, \(d_{\max}\) and \(d_{\min}\) are the maximum and minimum elements of all \(d_{pq}\ (\ p=1\ \sim\ n,\ q=1\ \sim n)\), respectively. Hence, by assembling the new elements \(d_{pq}^{e}\), the distance matrix representing the gap between the value of the temperature sensors is obtained:  
\[\mathbf{D^{e}}=\left[ \begin{array}{cccccc}0&d_{12}^{e}&\cdots&d_{1q}^{e}&\cdots &d_{1n}^{e}\\ d_{21}^{e}&0&\cdots&d_{2q}^{e}&\cdots&d_{2n}^{e}\\ \vdots&\vdots&\ddots&\vdots&\cdots&\vdots\\ d_{p1}^{e}&d_{p2}^{e}&\cdots&\ddots&\cdots&\vdots\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ d_{n1}^{e}&d_{n2}^{e}&\cdots&\cdots&\cdots&0\end{array} \right] \tag{6}\]  
Then, the distance matrix that represents the similarity between the temperature sensors is derived. The similarity between the temperature sensors can be represented by the correlation coefficient.