# Precipitation Estimation Using FY-4B/AGRI Satellite Data Based on Random Forest
## 2 Materials and Methods
### Methods
#### 2.3.4 Model Tuning and Testing
\[FAR=\frac{NB}{NA+NB} \tag{3}\]  
\[POD=\frac{NA}{NA+NC} \tag{4}\]  
\[CSI=\frac{NA}{NA+NB+NC} \tag{5}\]  
\[ETS=\frac{NA-dr}{NA+NB+NC-dr},\quad dr=\frac{(NA+NB)\cdot(NA+NC)}{NA+NB+NC+ND} \tag{6}\]  
where FAR indicates the proportion of the area with no actual precipitation in the total predicted precipitation area predicted by the model. POD represents the possibility that the model can correctly identify precipitation pixels when precipitation is actually observed. CSI represents the proportion of precipitation pixels in correctly classified pixels when the correctly classified non-precipitation points are moved out. ETS indicates the proportion of pixels that are correctly classified after considering contingencies compared with that of random prediction [46]. The smaller the FAR is, the higher the POD, CSI and ETS are, the lower the false alarm rate of precipitation events and the better its precipitation identification ability. According to the classification standard of rainfall, hourly rainfall can be divided into four classes: light rain (0.1-1.5 mm/h), moderate rain (1.5-7.0 mm/h), heavy rain (7.0-15.0 mm/h) and torrential rain (\(\geq\)15.0 mm/h) [47]. In the process of model training, the ratio of light rain, moderate rain, heavy rain and torrential rain in the dataset is 75:20:3:1, including a low number of pixels of heavy rain and torrential rain. Direct training of the randomly selected dataset will lead to a serious overestimation of light rain samples and a serious underestimation of heavy rain and torrential rain samples. The model may not learn the characteristics of heavy rain and torrential rain samples, resulting in a large error. Therefore, the upsampling method is used to greatly increase the number of samples of moderate rain, heavy rain and torrential \begin{table}
\begin{tabular}{c c c} \hline \hline  & **GPM IMERG: Precipitation** & **GPM IMERG: Non-Precipitation** \\ \hline RF Prediction: Precipitation & NA & NB \\ RF Prediction: Non-precipitation & NC & ND \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Classification table of precipitation. rain to solve the problem of sample imbalance. The ratio of light rain, moderate rain, heavy rain and torrential rain is set as 75:20:3:1 and 1:1:1:1, respectively, for training to evaluate the effect of the model and select the optimal sample ratio. Correlation coefficient (R), root mean square error (RMSE) and average error (BIAS) are used to evaluate the precipitation estimation model's effect [48]. \[R=\frac{\sum_{i=1}^{n}\left(S_{i}-\overline{S}\right)\cdot\left(I_{i}- \overline{I}\right)}{\sqrt{\sum_{i=1}^{n}\left(S_{i}-\overline{S}\right)^{2} \cdot\sum_{i=1}^{n}\left(I_{i}-\overline{I}\right)^{2}}} \tag{7}\]  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}\left(S_{i}-I_{i}\right)^{2}}{n}} \tag{8}\]  
\[BIAS=\frac{\sum_{i=1}^{n}S_{i}-I_{i}}{n} \tag{9}\]  
where \(S\) represents model prediction data, \(I\) represents observation data and \(n\) represents the number of matching points. The larger R is, the closer the model prediction data and the observed data are and the higher the data authenticity is. The smaller the RMSE, the smaller the degree of dispersion between the model prediction data and the observed data. The smaller the BIAS, the smaller the difference between the predicted data of the model and the observed data.