# Data Fusion of Multivariate Time Series: Application to Noisy 12-Lead ECG Signals
## 2 The Local Weighted Linear Prediction Algorithm
### Fuzzy Inference System Design for NDFA  
As an important application of fuzzy logic and fuzzy sets theory [25], the fuzzy inference system (FIS) has been successfully applied in decision support and other subjects. FIS is useful for dealing with linguistic concepts, via achieving nonlinear mappings between inputs and outputs. In this subsection, two simple FISs; FIS\({}_{d}\) and FIS\({}_{\alpha}\), will be devised, which can be used to estimate the weighted coefficients of LWLPA by the modulus of vector and the angle, respectively. Here, FIS\({}_{d}\) is applied to estimate the evolutionary trend of the reconstruction trajectory by the modulus \(D\) of the vector and the change rate \(D_{r}\) of the modulus of adjacent vectors. Thus, in FIS\({}_{d}\), there are two input variables \(D\), \(D_{r}\) and one output variable \(O_{d}\). The two variables \(D\) and \(D_{r}\) can be calculated as:  
\[D(p)=\left\|X(p)-X(p-1)\right\|_{2}, \tag{3}\]  
\[D_{r}(p)=\left|D(p)-D(p-1)\right|, \tag{4}\]  
where \(D(p)\) and \(D_{r}(p)\) are the Euclidean distance and the change rate of \(X(p)\) at \(p\)-step, respectively. In the further design of FIS\({}_{d}\), the universe of the three variables \(D\), \(D_{r}\) and \(O_{d}\) are set within the interval [0,1] uniformly. The universe of the variables \(D\), \(D_{r}\) and \(O_{d}\) are divided into several fuzzy sets and the numbers of the fuzzy sets are 3, 3 and 5, respectively, shown in Figure 2a-c. According to the aforementioned relationship, the inference rules of FIS\({}_{d}\) can be designed properly, which are summarized in Table 1. Based on FIS\({}_{d}\), the evolutionary trend of trajectory is estimated quantitatively and the parameter \(\omega_{d}\) can be calculated as:  
\[\omega_{d}=\frac{\sum_{q=1}^{h_{d}}\beta_{d}(q)y_{d}(q)}{\sum_{q=1}^{h_{d}} \beta_{d}(q)} \tag{5}\]  
where \(h_{d}\) is the number of rules of FIS\({}_{d}\), \(y_{d}(q)\) is the output of the \(q\)th rule and \(\beta_{d}(q)\) the rule activation for the \(q\)th rule. Similarly, the change of the reconstruction trajectory can also be reflected by the angle of the adjacent vectors. Thus, according to the aforementioned relationship, the fuzzy inference system FIS\({}_{\alpha}\) can be similarly designed. FIS\({}_{\alpha}\) consists of two inputs variables \(\alpha\), \(\alpha_{r}\) and one output variable \(O_{\alpha}\). The two input variables are the arc-cosine angle of \(\alpha\) and the change rate \(\alpha_{r}\) of the cosine function, which can be obtained as:  
\[\alpha(p)=\frac{V(p)\cdot V(p-1)}{|V(p)||V(p-1)|}, \tag{6}\]  
\[\alpha_{r}(p)=|\alpha(p)-\alpha(p-1)|, \tag{7}\]  
where \(\alpha(p)\) is the angle between two neighboring vectors \(V(p)\) and \(V(p-1)\); and \(\alpha_{r}(p)\) the change rate of the cosine function at \(p\)-step. In the design of FIS\({}_{\alpha}\), the universe of the input variable \(\alpha\) is set within the interval [\(-1\),1] and the other two variables, \(\alpha_{r}\) and \(O_{\alpha}\), are set within [0,1]. The universe of the variables \(\alpha\) is divided into five fuzzy sets and the number of the fuzzy sets of the other two variables, \(\alpha_{r}\) and \(O_{\alpha}\), are 3 and 7, respectively, shown in Figure 2d-f. Based on the aforementioned analysis, the inference rules of FIS\({}_{\alpha}\) is devised to describe the relationship between the change of trajectory and the angle of neighboring vectors felicitously, which are summarized in Table 2. With FIS\({}_{\alpha}\) being employed, we can obtain the quantitative parameter \(\omega_{\alpha}\), which is computed as:  
\[\omega_{\alpha}=\frac{\sum_{q=1}^{h_{\alpha}}\beta_{\alpha}(q)y_{\alpha}(q)}{ \sum_{q=1}^{h_{\alpha}}\beta_{\alpha}(q)} \tag{8}\]where \(h_{\alpha}\) is the number of rules of \(\text{FIS}_{\alpha}\), \(y_{\alpha}(q)\) is the output of the \(q\)th rule and \(\beta_{\alpha}(q)\) the rule activation for the \(q\)th rule.