The pseudo code of the PCA Algorithm

Piecewise Aggregation divides the original data of length

better reconstruction of the original data, however more data

space is needed to store the data and eventually higher energy

consumption by higher communication costs

Input: x1, ..., xn d length vector, k

Output: Transform matrix R

X ⇐ n × d data matrix with xi in each row;

X ⇐ subtract x' from each row in X;

Compute eigenvalue e1, ..., ed of COV, and sort them;

Compute matrix V which satisfy V1 × COV × V = D, D is the diagonal matrix of eigenvalue of COV;

R ⇐ the first k column of V