# The Optimal Dispatch of a Power System Containing Virtual Power Plants under Fog and Haze Weather
## 2 F-H Impacts on Photovoltaic Output and Load Forecasts
### Selection of \"Similar Days of F-H\"  
The prediction accuracy of photovoltaic output and load forecasts would improve to some degree if input data were selected from days with a similar temperature, light intensity, weather type, day type, _etc._ The above analysis indicates that there are great similarities in photovoltaic outputs (or loads) under the same AQI level, which cannot be ignored. Therefore, the idea of similar days of F-H is introduced in this paper, which emphasizes F-H weather based on the former research. (1) Select similar days of F-H for photovoltaic output:  
Step 1. Data preprocessing:  
The order of magnitudes of different data varies greatly, which makes it difficult for any model to implement predictions. Therefore, data should be normalized or mapped to the range of [0,1] before calculating according to Formula (2):  
\[Y=\frac{X-X_{\min}}{X_{\max}-X_{\min}} \tag{2}\]  
where \(X\) is one of the samples; \(X_{\max}\) and \(X_{\min}\) are the maximal and minimal values of samples; \(Y\) is the normalized value of \(X\). Besides, the relation of weather types and their values could be listed as follows: sunny, 1.0; cloudy, 0.9; overcast, 0.8; rainy, 0.6; snowy, 0.2; sunny to cloudy, 0.95; cloudy to overcast, 0.85; overcast to rainy, 0.75; cloudy to snowy, 0.45; _etc._[15]. Step 2. Principal component analysis (PCA):  
Traditional methods to select similar days need more calculation time on account of the enormous raw data volume. The PCA is a statistical method that could convert multiple variables \(X_{i}\) (\(i\) = 1,2,...,\(n\)) into a few comprehensive independent variables \(Y_{k}\) (\(k\) = 1,2,...,\(m\)), as shown in Formula (3):  
\[ \begin{array}{c}Y_{k}=a_{k1}X_{1}+a_{k2}X_{2}+\cdots+a_{ki}X_{i}+\cdots+a_{ kn}X_{n}\\ Y=[Y_{1}Y_{2},...,Y_{m}],X=[X_{1}X_{2},...,X_{n}],m\leqslant n\\ Y_{C}=\sum\limits_{k=1}^{m}Y_{k}v_{k}\end{array}  \tag{3}\]  
where \(n\) and \(m\) are the numbers of variables \(X\) and \(Y\), and \(m\) is set according to demand; \(Y_{C}\) is the integrative factor; \(a_{ki}\) (\(k\) = 1,2,...,\(m\), \(i\) = 1,2,...,\(n\)) are principal component coefficients; and \(v_{k}\) (\(k\) = 1,2,...,\(m\)) are component contribution rates, the calculations of which could refer to [15,16]. The integrative factor \(Y_{C}\), which reflects the summarized information of original data and deletes unimportant factors, could replace original photovoltaic output in the following analysis. Step 3. Grey correlation analysis (GCA):  
In order to select similar days, the correlations between photovoltaic output and relative factors need to be analyzed first. The GCA, which has a good effect to solve the problem of multi-variables without obvious regularity, is a mature theory in this field and employed in this section [15,17]. The values of the integrative factors \(Y_{C}\) of the photovoltaic outputs form a basic sequence \(y\), and the relative factors form compared sequences \(z_{i}\) (\(i\) = 1,2,... \(p\)), the curve similarities of which reflect the degrees of relation. \[ \begin{array}{l}y=\left\{y(k)\left|k=1,2,\cdots n\right.\right\},z_{i}=\left\{ z_{i}(k)\left|k=1,2,\cdots n\right.\right\}\\ \zeta_{i}(k)=\frac{\Delta_{i}(k)_{\min}+\rho\Delta_{i}(k)_{\max}}{\Delta_{i}( k)+\rho\Delta_{i}(k)_{\max}},\Delta_{i}(k)=\left|y(k)-z_{i}(k)\right|\\ \gamma_{i}=\frac{1}{n}\sum\limits_{k=1}^{n}\zeta_{i}(k),i=1,2,...,p\end{array}  \tag{4}\]  
where \(\Delta_{i}(k)_{\min}\) and \(\Delta_{i}(k)_{\max}\) are the minimal and maximal values of \(\Delta_{i}(k)\); \(\rho\)\(\in\)(0, \(\infty\)) is the distinguish coefficient; \(n\) is the sequence length; \(p\) is the number of compared sequences; \(\gamma_{i}\) is the degree of correlation between \(y\) and \(z_{i}\). Step 4. Weighted similarity formula (WSF):  
The WSF combined with all values of the degree of relation in Step 3 is adopted to calculate the degree of similarity \(sim(k)\) between the day to predict and a given historical day [15]. \[