# Short-Term Wind Speed Prediction Based on Principal Component Analysis and LSTM
## 2 Methodology
### PCA Algorithm  
In many cases, there is a correlated relationship among variables, which makes the problem under study very complicated. When there is a certain correlation between two variables, it can be explained that the two variables reflecting the information of this problem have a certain overlap. PCA is devised to delete redundant (closely related) variables and to establish as few new variables as possible, so that these new variables are irrelevant [37].  
In the PCA algorithm, orthogonal transformation is used to convert a set of variables that may have linear correlation into a set of linearly uncorrelated variables. The converted variables are used as the principal components. Take a data matrix of \(M\times N\) as shown in Equation (1), for example; it means that there are \(N\) samples, and each sample has \(M\) features.  
\[T=\left[\begin{array}{cccc}d_{11}&d_{12}&\cdots&d_{1N}\\ d_{21}&d_{22}&\cdots&d_{2N}\\ \vdots&\vdots&\ddots&\vdots\\ d_{M1}&d_{M2}&\cdots&d_{MN}\end{array}\right] \tag{1}\]  
The calculation process of the PCA algorithm to reduce the dimensions of \(T\) is as follows:  
1. Calculate the covariance matrix of \(T\) by Equation (2): \[Q=\frac{\Sigma_{n=1}^{N}\left(T_{n}-\overline{T}\right)\left(T_{n}-\overline{ T}\right)^{\prime}}{N-1}\] (2) where \(Q\) is the covariance matrix; \(T_{n}\) represents the \(n\)th sample vector; \(\overline{T}\) denotes the mean value of the \(n\)th sample; and \(\left(T_{n}-\overline{T}\right)^{\prime}\) is the transposed matrix.
2. Calculate the eigenvalues and eigenvectors of \(Q\) by Equation (3): \[Q=\sum_{n=1}^{M}\lambda_{m}v_{m}v_{m}{}^{\prime}=V\Lambda V^{\prime}\] (3) where \(v_{m}\) is the \(m\)th eigenvector of \(Q\) and \(\lambda_{m}\) is the \(m\)th eigenvalue of \(Q\). \(V\) and \(\Lambda\) are composed of eigenvectors and eigenvalues of \(Q\), respectively.  
Arrange the eigenvalues from large to small and then calculate the contribution rate of each feature and cumulative contribution rate of all features by Equations (4) and (5) as follows:  
\[p_{l}=\lambda_{l}/\sum\
olimits_{l=1}^{M}\lambda_{l} \tag{4}\]  
\[\overline{p}=\sum\
olimits_{l=1}^{M}p_{l} \tag{5}\]  
where \(p_{l}\) is the contribution rate of the \(l\)th component, \(\lambda_{l}\) is the \(l\)th eigenvalue arranged from large to small. \(\overline{p}\) represents the cumulative contribution rate.
4. According to (3), select \(I\) (\(I\leq M\)) components which contain the most information of \(T\) from \(M\) components. The eigenvectors corresponding to the selected components constitute the transformation matrix \(U\). The reduced dimension matrix \(Z\) is obtained by multiplying the original data matrix \(T\) and the transformation matrix \(U\) as described in Equation (6) \[Z=TU=T(V_{1},V_{2},\ldots,V_{I})\] (6) where \(Z\) is the reduced dimension matrix m. \(U\) represents the transformation matrix.  
In this paper, up to 11 meteorological characteristics affecting wind speed are collected, including air temperature, air pressure, humidity, and so forth. The PCA algorithm above is employed to reduce the dimensions of the meteorological data. The data after dimensionality reduction can effectively keep the original meteorological information as much as possible.