## 4 Method
### Generative Adversarial Imputation Nets  
GAIN utilizes a streamlined neural network, incorporating a generator-discriminator architecture to construct the data recovery framework to complete the task of missing data imputation. The basic flowchart of GAIN is as follows. As shown in Figure 3, GAIN operates through an iterative process that involves a generator, a hint mechanism, and a discriminator. Initially, the generator predicts the missing values in a dataset by leveraging known features and incorporating hints derived from the statistical properties of the data. These generated data are then assessed by the discriminator, which evaluates the authenticity of the imputed values against the real observed data, providing feedback to the generator. The generator and discriminator engage in a competitive learning process, with the generator striving to produce more accurate imputations while the discriminator enhances its ability to distinguish between real and generated data. This adversarial framework enables GAIN to effectively fill in missing entries, thereby improving the overall quality and usability of the dataset. Figure 2: The methodological framework for flood prediction in PRB. The Generator in GAIN is a neural network responsible for predicting missing values within the data. Its role is to approximate these missing entries by leveraging the observed features and incorporating additional hints from known data, thereby creating plausible data points that align closely with the real values. The Generator function can be represented as follows:  
\[ \begin{array}{c}\overline{X}=G(X,M,(1-M)\odot Z)\\ \widehat{X}=M\odot X+(1-M)\overline{X}\end{array}  \tag{1}\]  
where \(\overline{X}\) denotes a vector comprising imputations. \(\widehat{X}\) denotes the complete data vector after imputation. \(G\) denotes the Generator. \(M\) denotes the binary mask matrix, where \(1\) indicates observed data and \(0\) indicates missing values. \(Z\) denotes the noise variable inputs. \(\odot\) denotes the Hadamard product. The Generator accurately approximates the missing data, leveraging both observed data and hints. This imputation contributes to higher data completeness and reliability, essential for subsequent analysis and modeling tasks. The Hint mechanism is a matrix that provides additional guidance to the generator on the locations of missing values, enhancing the accuracy of data imputation. The hint mechanism is formulated as follows:  
\[ \begin{array}{c}H=B\odot M+0.5(1-B)\\ B=(B_{1},\dots,B_{d})\in\{0,1\}^{d}.\end{array}  \tag{2}\]  
where \(H\) represents the hint matrix that guides the generator in the imputation process by indicating the locations of missing values. The binary vector \(B\), consisting of elements \(B_{1},\dots,B_{d}\), serves to introduce variability in the hint information, where each element can either denote the presence or absence of a hint for the corresponding feature. This representation suggests that \(B\) is used to control the hint information across \(d\) features in the dataset, allowing for a flexible and varied application of hints during the imputation process. It combines the random variable \(B\) and the mask matrix \(M\), allowing the Hint matrix \(H\) to provide partial information about the locations of missing values, thereby assisting the generator in more accurately approximating the true data distribution during imputation. The Discriminator in GAIN is a neural network that evaluates the authenticity of the imputed values generated by the Generator, distinguishing between observation and synthetic data. Its primary function is to provide feedback to the Generator, guiding it to improve the quality of its imputations by accurately classifying data as generated.