# Short-Term Wind Speed Prediction Based on Principal Component Analysis and LSTM
## 3 Case Study
### Experimental Design and Parameter Settings  
We first used the PCA algorithm to calculate the contribution and cumulative contribution rate of each component as shown in Table 2. It can be seen that as the number of features increased, the correlation became more and more obvious, which means that there was no need to measure all the features. The cumulative contribution rate of the first five principal components was 0.9653. Therefore, these five principal components and wind speed were selected to form the input to the prediction models.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Feature Number** & **Factor** & **Unit** & **Min** & **Max** & **Mean** & **Std** \\ \hline
1 & Air pressure & hpa & 902 & 919.5 & 909.96 & 3.42 \\
2 & Sea level pressure & hpa & 993.9 & 1017.4 & 1004.5 & 4.37 \\
3 & Air temperature & \({}^{\circ}\)C & 10.2 & 35.3 & 22.64 & 5.09 \\
4 & Apparent temperature & \({}^{\circ}\)C & 9.16 & 32.32 & 21.74 & 4.85 \\
5 & Extreme wind speed & m/s & 1.2 & 15.65 & 6.48 & 3.76 \\
6 & Wind level & \(\backslash\) & 1 & 6 & 2.62 & 1.27 \\
7 & Relative humidity & \% & 10 & 91 & 40.88 & 16.99 \\
8 & Minimum relative humidity & \% & 8 & 90 & 38.3 & 16.28 \\
9 & Vapor pressure & hpa & 4.3 & 18.4 & 10.36 & 2.41 \\
10 & Precipitation & mm & 0 & 0.7 & 0.00 & 0.04 \\
11 & Horizontal visibility & m & 7500 & 35,000 & 34,462 & 2652.5 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Basic information of meteorological factors.  
To validate the prediction performance of the proposed PCA-LSTM method, BPNN-, SVR-, GPR-, and RNN-based methods were selected for comparison. The following three cases were studied:  
Case I: LSTM model optimized by DE algorithm and comparisons with BPNN, GPR, RNN, and SVR only using historical wind speed data  
Case II: Feature-LSTM model optimized by DE algorithm and comparisons with Feature-BPNN, Feature-GPR, Feature-RNN, and Feature-SVR using all meteorological factors related to wind speed data  
Case III: the proposed model and comparisons with PCA-BPNN, PCA-GPR, PCA-RNN, and PCA-SVR using meteorological factors processed by the PCA algorithm.  
On the basis of several trials and similar works [40, 41], the parameters of the DE algorithm were set as follows: population size NP = 10, number of iterations G = 20, scaling factor F = 0.6, and crossover factor CR = 0.8. For the LSTM network, the range of the learning rate was specified within [0, 1], the range of the number of hidden layer units was within [1, 100], and the range of the batch size was specified within [1, 100]. Table 3 shows parameter settings of LSTM determined by the DE algorithm and other models. Furthermore, the Adam algorithm was adopted to make calculation of the LSTM network more efficient [40]. For SVR and GPR, the results of each run were the same, hence, they ran once. For network-based methods, such as BPNN, LSTM, and RNN, the results obtained by each run were different; these models ran independently for 10 times, and the average was recorded as the final result.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Principal Component** & **Eigenvalues** & **Contribution Rate** & **Cumulative Contribution Rate** \\ \hline First & 0.2189 & 0.5238 & 0.5238 \\ Second & 0.0843 & 0.2017 & 0.7255 \\ Third & 0.0661 & 0.1582 & 0.8837 \\ Fourth & 0.0203 & 0.0485 & 0.9322 \\ Fifth & 0.0138 & 0.0331 & 0.9653 \\ Sixth & 0.0091 & 0.0217 & 0.9870 \\ Seventh & 0.0027 & 0.0065 & 0.9935 \\ Eighth & 0.0021 & 0.0051 & 1.0 \\ Ninth & 0.0003 & 0.0007 & 1.0 \\ Tenth & 0.0003 & 0.0006 & 1.0 \\ Eleventh & 0 & 0 & 1.0 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Calculation results of each principal component.  
Figure 4: Training set and test set.