# Tri-Partition Alphabet-Based State Prediction for Multivariate Time-Series
## 3 Models and Problem Statement
### State  
First, a formal description of the state is introduced as follows. Additionally, the type of prediction result that the SAX-MTS state is was described. **Definition 4**. : _Given a SAX-MTS \(S=(T,A,V=\cup_{\mu\in A}V_{a},f)\): \(\forall i\in[1,m]\),_  
\[\mathbf{f}_{i,*}=(f_{i,1},f_{i,2},\ldots,f_{i,n}) \tag{4}\]  
_is called a state of SAX-MTS at time \(t_{i}\). Moreover, the state of PAA-MTS (i.e, \(\mathbf{f}^{{}^{\prime}}_{i,*}=(f^{{}^{\prime}}_{i,1},f^{{}^{\prime}}_{i,2}, \ldots,\)\(f^{{}^{\prime}}_{i,n})\)) is formally similar to this one._  
**Example 5**. : _With Table 3, \(\mathbf{f}_{10,*}=\)[e, g, f] is called a state of SAX-MTS at time \(t_{10}\). Accordingly, \(\mathbf{f}^{{}^{\prime}}_{10,*}=\)[0.447, 1.038, 0.846] is called a state of PAA-MTS at time \(t_{10}\)._  
Second, the state \(\mathbf{f}_{i,*}\) is denoted as a known label. This way, the corresponding instance of \(\mathbf{f}_{i,*}\) is defined as follows. **Definition 5**. : _Given an SAX-MTS \(S=(T,A,V,f)\) and a sliding window \(w<m\), an instance with the matrix form is:_  
\[O^{w,n}_{i}= \begin{pmatrix}f_{i-w+1,1}&\ldots&f_{i-w+1,n}\\ \vdots&\ddots&\vdots\\ f_{i,1}&\ldots&f_{i,n}\end{pmatrix} =(\mathbf{f}^{i}_{*,1},\ldots,\mathbf{f}^ {i}_{*,n})= \begin{pmatrix}\mathbf{f}^{i}_{i-w+1,*}\\ \vdots\\ \mathbf{f}^{i}_{i,*}\end{pmatrix} , \tag{5}\]  
_where \(w\in(0,m)\), \(i\in[w,m]\), and \(\forall j\in[1,n]\), \(|\mathbf{f}^{i}_{*,j}|=w\), \(\forall j\in[i-w+1,i],|\mathbf{f}^{i}_{j,*}|=w\). For brevity, \(O^{w,n}_{i}\) can be denoted by \(O_{i}\) when \(n\) and \(w\) are specified:_  
**Example 6**. : _With Table 3, let \(w=2\) and \(i=9\); then:_  
\[O_{9}= \begin{pmatrix}c&d&c\\ c&c&b\end{pmatrix} .\]  
\(\mathbf{f}_{10,*}=\)[e, g, f] is the label of \(O_{9}\). This way, the set of all instances can be denoted by  
\[\mathbf{SP}=\{O_{w},O_{w+1},\ldots,O_{m}\}, \tag{6}\]  
where \(|\mathbf{SP}|=|T|-w=m-w+1\). **Example 7**. : _With Table 3, let \(w=2\); then, \(\mathbf{SP}=\{O_{2},O_{3},\ldots O_{10}\}\). Hence, \(|\mathbf{SP}|=10-2+1=7\)._  
Third, \(\forall i\in[w,m-1]\), the set of instance-label pair \(\{(O_{i},\)\(\mathbf{f}_{i+1,*})\}\) can be constructed for the \(k\)-nearest matrix neighbors (\(k\)NMN). **Definition 6**. : _Given an instance \(O_{m}\in\mathbf{SP}\), any \(\mathbf{N}\subseteq\mathbf{SP}\setminus\{O_{m}\}\) is called the set of \(k\)NMN of \(O_{m}\) if \(|\mathbf{N}|=k\) and:_  
\[\min_{O^{{}^{\prime}}\in\mathbf{N}}\Delta(O_{m},O^{{}^{\prime}})\geq\max_{O^{ {}^{\prime\prime}}\in\mathbf{SP}\setminus\mathbf{N}}\Delta(O_{m},O^{{}^{\prime \prime}}), \tag{7}\]  
_where \(\Delta\) is the along-across similarity of the given matrix pair._  
Note that the neighborhood \(\mathbf{N}\) for \(O_{m}\) may not be unique, where some other matrices have the same similarity with \(O_{m}\). Fourth, the along-across similarity model \(\Delta\) is proposed to obtain the neighborhood \(\mathbf{N}\) by merging the popular similarity and distance metrics. **Definition 7**. : _Given PAA-MTS \(S^{{}^{\prime}}=(T,A,V^{{}^{\prime}},f^{{}^{\prime}})\), SAX-MTS \(S=(T,A,V,f)\), and sliding window size \(w\), the similarity between the two matrix-based instances \(O_{i}\) and \(O_{j}\) is:_  
\[\Delta(O_{i},O_{j})=R_{i,j}\times C_{i,j}, \tag{8}\]  
_where the row vector similarity is:_  
\[R_{i,j}=\frac{\sum_{l=1}^{w}s(\mathbf{h}_{i-w+l,s^{\prime}}^{i},\mathbf{h}_{j -w+l,s}^{j})}{w}, \tag{9}\]  
_and the column vector similarity is:_  
\[C_{i,j}=\frac{\sum_{l=1}^{n}s(\mathbf{h}_{s^{\prime},l}^{i},\mathbf{h}_{s,l}^{ j})}{n}, \tag{10}\]  
_where:_  
\[\mathbf{h}= \begin{cases}\mathbf{f}^{{}^{\prime}},&\text{if the metric is available for the PAA-MTS;}\\ \mathbf{f},&\text{if the metric is available for the SAX-MTS.}\end{cases}  \tag{11}\]  
Note that the row or column vector \(\mathbf{h}\) in Equation (11) is indeed one of \(\mathbf{f}^{{}^{\prime}}\) and \(\mathbf{f}\), corresponding to PAA- and SAX-MTSs, respectively. Moreover, the data type of vector \(\mathbf{h}\) in Equations (9) and (10) are coincident.