## 2 Principal component aggregation in wireless sensor networks
### Principal component analysis  
This section describes the Principal Component Analysis (PCA), a well-known dimensionality reduction technique in statistical data analysis, data compression, and image processing [28, 29]. The technique is based on a basis change which reduces the number of coordinates used to represent the data while maximizing the variance retained. Its use is particularly adapted to correlated data where the dimensionality of the data can be strongly reduced while retaining most of the measurement variations. Given a set of \(N\) centered multivariate measurements \(\mathbf{x}[t]\in\mathbb{R}^{p}\) used as training samples,1\(1\leq t\leq N\), the PCA basis is obtained by minimizing the following optimization function  
Footnote 1: Measurements are centered so that the origin of the coordinate system coincides with the centroid of the set of measurements. This translation is desirable to avoid a biased estimation of the basis \(\{\mathbf{w}_{\mathbf{k}}\}_{1\leq k\leq q}\) of \(\mathbb{R}^{p}\) towards the centroid of the set of measurements. \[ \begin{array}{rcl}J_{q}(\mathbf{x}[t],\mathbf{w}_{\mathbf{k}})&=&\frac{1}{N} \sum_{t=1}^{N}||\mathbf{x}[t]-\sum_{k=1}^{q}\mathbf{w}_{\mathbf{k}}\mathbf{w}_ {\mathbf{k}}^{\mathbf{T}}\mathbf{x}[t]||^{2}\\ &=&\frac{1}{N}\sum_{t=1}^{N}||\mathbf{x}[t]-\mathbf{\hat{x}}[\mathbf{t}]||^{2} \end{array}  \tag{1}\]  
where the set of \(q\leq p\) vectors \(\{\mathbf{w}_{\mathbf{k}}\}_{1\leq k\leq q}\) of \(\mathbb{R}^{p}\) form the PCA basis. The linear combinations \(\mathbf{\hat{x}}[\mathbf{t}]=\sum_{k=1}^{q}\mathbf{w}_{\mathbf{k}}\mathbf{w}_ {\mathbf{k}}^{T}\mathbf{x}[t]\) represent the projections of \(\mathbf{x}[t]\) on the PCA basis, and Eq. (1) therefore quantifies the mean squared error the original measurements \(\mathbf{x}[t]\) and their projections. Note that the optimization function equivalently maximizes the variance retained by the family of vectors \(\{\mathbf{w}_{\mathbf{k}}\}_{1\leq k\leq q}\). Setting to zero the derivative of \(J_{q}(\mathbf{x}[t],\mathbf{w_{k}})\) with respect to \(\mathbf{w_{k}}\) gives  
\[\mathbf{C}\mathbf{w_{k}}=\lambda_{k}\mathbf{w_{k}} \tag{2}\]  
where \(\mathbf{C}=\frac{1}{N}\sum_{t=1}^{N}\mathbf{x}[t]\mathbf{x}[t]^{T}\) is the sample covariance matrix of the sensor measurements \(\mathbf{x}[t]\). The minimizer of Equation (1) is therefore given by the set of the first \(q\) eigenvectors \(\{\mathbf{w_{k}}\}\) of the sample covariance matrix \(\mathbf{C}\)[28]. These eigenvectors are called the _principal components_ and form the PCA basis. The corresponding eigenvalues \(\lambda_{k}\) quantify the amount of variance conserved by the eigenvectors. Indeed, left-multiplying Equation (2) by \(\mathbf{w_{k}}^{T}\) gives  
\[\mathbf{w_{k}}^{T}\mathbf{C}\mathbf{w_{k}}=\mathbf{w_{k}}^{T}\lambda_{k} \mathbf{w_{k}} \tag{3}\]  
and as \(\mathbf{w_{k}}^{T}\mathbf{C}\mathbf{w_{k}}=\mathbf{w_{k}}^{T}(\frac{1}{N}\sum _{t=1}^{N}\mathbf{x}[t]\mathbf{x}[t]^{T})\mathbf{w_{k}}=\sum_{t=1}^{N}\mathbf{ \hat{x}[t]}^{T}\mathbf{\hat{x}[t]}\) and \(\mathbf{w_{k}}^{T}\mathbf{w_{k}}=1\), each eigenvalue \(\lambda_{k}\) quantifies the variance of the projections of the measurements \(\mathbf{x}[t]\) on the corresponding \(k\)-th eigenvector. The sum of the eigenvalues therefore equals the total variance of the original set of observations \(X\), i.e. :  
\[\sum_{k=1}^{p}\lambda_{k}=\frac{1}{N}\sum_{t=1}^{N}||\mathbf{x}[t]||^{2}\]  
It is convenient to order the vectors \(\mathbf{w_{k}}\) by decreasing order of the eigenvalues, so that the proportion \(P\) of retained variance by the first \(q\) principal components can be expressed by:  
\[P(q)=\frac{\sum_{k=1}^{q}\lambda_{k}}{\sum_{k=1}^{p}\lambda_{k}} \tag{4}\]  
Storing columnwise the set of vectors \(\{\mathbf{w_{k}}\}_{1\leq k\leq q}\) in a \(W_{p\times q}\) matrix, approximations \(\mathbf{\hat{x}[t]}\) to \(\mathbf{x}[t]\) in \(\mathbb{R}^{p}\) are obtained by:  
\[\mathbf{\hat{x}[t]}=WW^{T}\mathbf{x}[t]=W\mathbf{z[t]} \tag{5}\]  
where  
\[\mathbf{z[t]}=W^{T}\mathbf{x}[t]=\left(