## 2 Methodology
### Hysteresis Effect of Precipitation  
The area where the group of small hydropower stations is located has a wide rain-collecting surface and complex terrain, so it takes a long time for the precipitation in a certain period to have a significant impact on the output of the group of small hydropower stations. Therefore, the variation in the daily power generation of the small hydropower stations has an obvious time lag relative to the precipitation in a certain period, and its variation may be affected by the precipitation in the current period, the previous period, or even the previous several periods. When selecting the precipitation to forecast the daily power generation of small hydropower stations, it is necessary to consider not only the precipitation in the current period but also the precipitation patterns in previous periods.  
Partial mutual information (PMI) is an extension of mutual information (MI) [15] and is used to measure the correlation between multiple random variables. PMI is similar to the partial correlation coefficient, which quantifies the dependency between the output \(Y\) and the variable \(Z\) after considering the input variable \(X\)[16; 17; 18].  
When considering the influence of precipitation patterns in previous periods on the daily power generation of small hydropower stations, it is assumed that \(X\) and \(Z\) are the precipitation in two periods, and \(Y\) is the change in power generation after being affected. If there is a connection between \(X\) and \(Z\), the correlation between \(Y\) and \(Z\) will be overestimated. Therefore, we use the conditional expectation to remove the information of  
Figure 1: Schematic diagram of precipitation estimation at any location.  
\(X\) contained in \(Y\) and \(Z\) before measuring their correlation. After removing the information of \(X\), \(Y\) and \(Z\) are, respectively, denoted as \(u\) and \(v\):  
\[E[x|z]\ =\ \frac{1}{n}\sum_{i=1}^{n}w_{i}\Big{(}x_{i}+(z-z_{i})^{T}S_{zz}^{-1}S_{ xz}\Big{)} \tag{3}\]  
\[w_{i}=\exp\left(-\frac{(z-z_{i})^{T}S_{zz}^{-1}(z-z_{i})}{2h^{2}}\right)/\sum _{j=1}^{n}\exp\left(-\frac{(z-z_{j})^{T}S_{zz}^{-1}(z-z_{j})}{2h^{2}}\right), \tag{4}\]  
where \(S_{xz}\) is the cross-covariance between two random vectors \(X\) and \(Z\), \(S_{zz}\) is the sample covariance of \(Z\), and \(n\) is the number of samples in the vector.  
\[u =Y-E[Y|Z] \tag{5}\] \[v =X-E[X|Z] \tag{6}\]  
Then, the partial mutual information between \(Y\) and \(Z\), that is, the correlation between them, is denoted as:  
\[PMI(Y,Z)=I(v,u)\approx\frac{1}{n}\sum_{i=1}^{n}\log\left[\frac{f(v_{i},u_{i})} {f(v_{i})f(u_{i})}\right], \tag{7}\]  
where \(f\) represents the density estimation function, and we use the Gaussian kernel density estimation function to estimate the probability density of each variable.  
The precipitation data set of the previous \(m\) periods is \(C=\{P_{t}\), \(P_{t-1}\), \(P_{t-2}\), \(P_{t-3}\),..., \(P_{t-m}\}\), the change in power generation is \(Y=\{\Delta E_{t}\}\), and the precipitation in the period with the most significant correlation with \(Y\) is stored in set \(S\). Then, the PMI variable selection process is shown in Algorithm 1. The Akaike information criterion (\(AIC\)) [19] is used as the stopping criterion in the selection process, and its expression is as follows:  
\[AIC=n\log\left(\frac{1}{n}\sum_{i=1}^{n}u_{i}^{2}\right)+2(p+1)^{2}, \tag{8}\]  
where \(u\) is the residual of \(Y\) obtained after calculating the conditional expectation according to the selected variables, \(n\) is the number of samples, and \(p\) is the number of the selected precipitation periods. With the screening of independent variables, the \(AIC\) value decreases continuously, and the screening ends when it reaches the minimum value, which means that the input variable set with the most significant correlation has been selected.