# Indoor Emission Sources Detection by Pollutants Interaction Analysis
## 2 Measurements and Method
### Correlation Coefficient-Based Emission Sources' Detection
#### 2.3.2 Data Filtering  
To remove short-term fluctuations associated with the noise of the measurements from observed pollutants, the correlation coefficient was included in this work to establish the relationships among pollutants in each time window. The correlation is a measure of the strength of relationship among pollutants in a subsequence \(\mathbf{c}_{i}\).  
As \(\mathbf{c}_{i}\) approximates the original time series with a combination of \(M\) pollutants in the \(i\)th sliding window, we represent \(\mathbf{c}_{i}\) as a combination of \(M\) column vectors,  
\[\mathbf{c}_{i}=\{\mathbf{a}_{i,\mathbf{1}},\mathbf{a}_{i,\mathbf{2}},\ldots,\mathbf{a}_{i,\mathbf{M}}\}, \tag{1}\]  
where \(\mathbf{a}_{i,\mathbf{m}}=\{a_{i,m}(1),a_{i,m}(2)\ldots,a_{i,m}(w)\}\) represents the \(m\)th pollutant vector for the \(i\)th sliding window.  
For each sliding window \(i\), we define the correlation model as a covariance of every two pollutants,  
\[r_{i,j,k}=r_{(\mathbf{a}_{i,j},\mathbf{a}_{i,k})},j\
eq k,j,k=1,2\ldots M, \tag{2}\]  
in which the population correlation between two pollutants is calculated as:  
\[r_{(\mathbf{a}_{i,j},\mathbf{a}_{i,k})} = \frac{Cov(\mathbf{a}_{i,j},\mathbf{a}_{i,k})}{\sqrt{Var(\mathbf{a}_{i,j})*Var( \mathbf{a}_{i,k})}} \tag{3}\] \[= \frac{\mathbb{E}((\mathbf{a}_{i,j}-\mathbb{E}(\mathbf{a}_{i,j}))(\mathbf{a}_ {i,k}-\mathbb{E}(\mathbf{a}_{i,k}))}{\sqrt{\mathbb{E}(\mathbf{a}_{i,j}-\mathbb{E}( \mathbf{a}_{i,j}))^{2}\mathbb{E}(\mathbf{a}_{i,k}-\mathbb{E}(\mathbf{a}_{i,k}))^{2}}}\] \[= \frac{\sum_{i=1}^{w}(\mathbf{a}_{i,j}(t)-\bar{\mathbf{a}}_{j,i})(\mathbf{a}_ {i,k}(t)-\bar{\mathbf{a}}_{i,k})}{\sqrt{\sum_{i=1}^{w}(\mathbf{a}_{i,j}(t)-\bar{\mathbf{a }}_{i,j})^{2}\sum_{i=1}^{w}(\mathbf{a}_{i,k}(t)-\bar{\mathbf{a}}_{i,k})^{2}}}\]  
where \(Var\) is the variance function, \(Cov\) is the covariance function and \(\mathbb{E}\) is the mathematical expectation. The correlation coefficient \(r_{(\mathbf{a}_{i,j},\mathbf{a}_{i,k})}\) is a number between \(-1\) and \(1\), which expresses the degree that, on an average, two pollutants change correspondingly. If one increases when the second pollutant increases, then there is a positive correlation. In this case the correlation coefficient will be closer to \(1\). If one decreases and the other increases simultaneously, then there is a negative correlation and the correlation coefficient will be closer to \(-1\). As a result, we obtain a correlation efficient matrix \(\mathbf{D}\in\mathcal{R}^{n\times\frac{M(M-1)}{2}}\) as,  
Figure 2: Data sequences \(\mathbf{X}\) with length \(T\), the subsequence of length \(w=120\) and the subsequences extracted by a sliding window \(c\). Note that the sliding windows overlap.  
\[\begin{array}{rcl}\mathbf{D}&=\left\{\begin{array}{cccc}r_{1,1,2}&r_{1,1,3}&\dots&r_ {1,M,M-1}\\ r_{2,1,2}&r_{2,1,3}&\dots&r_{2,M,M-1}\\ \vdots&&\dots&&\vdots\\ r_{n,1,2}&r_{n,1,3}&\dots&r_{n,M,M-1}\end{array}\right\}\\ &=\left\{\mathbf{r}_{i}\right\}_{i=1}^{M}\end{array} \tag{4}\]  
in which \(\mathbf{r}_{i}\in\mathcal{R}^{1\times\frac{M(M-1)}{2}}\) represents one data instance. The class label of the instance \(y_{i}\) is given according to events of emission sources for each sliding window. Now, the problem of emission event detection is to seek an optimal solution to \(f^{*}:\mathbf{r}_{i}\to y_{i},i=1,\dots,n\).