# Spatiotemporal Assessment and Correction of Gridded Precipitation Products in North Western Morocco
## 2 Materials and Methods
### Methodology
#### 2.3.2 Regression Metrics  
In regression, the objective is to predict a continuous value rather than a class label [43]. Unlike classification, where accuracy is measured by predicting the correct class label, regression focuses on the closeness of the prediction to the actual value [58]. Commonly used regression metrics in machine learning include \(R^{2}\) score (coefficient of determination) and Pearson correlation coefficient, as well as root mean squared error (RMSE) and mean absolute error (MAE).  
The \(R^{2}\) score evaluates the model's prediction quality in linear regression by assessing its performance relative to the variance in the data. It provides an indication of how well the satellite data correspond to the observed data. RMSE and MAE serve similar purposes, measuring the average magnitude of the error between estimated and observed precipitation values [59]. RMSE gives more weight to larger errors compared to MAE. Squaring the errors in RMSE amplifies the effect of larger errors, which can be useful in situations where large errors are particularly undesirable. This means that the RMSE is sensitive to outliers, while MAE is less affected by extreme values [60]. RMSE is often  
\begin{table}
\begin{tabular}{c c} \hline \hline \(\text{ACC}=\frac{\text{TP+TN}}{\text{TP+TN+FP+FN}}\) & \(\text{Specificity}=\frac{\text{TN}}{\text{TN+FP}}\) \\ \hline \(\text{Err}=\frac{\text{FP+FN}}{\text{TP+TN+FP+FN}}=1-\text{ACC}\) & \(\text{FPR}=1-\text{Specificity}=\frac{\text{FP}}{\text{FP+TN}}\) \\ \hline \(\text{Precision}=\frac{\text{TP}}{\text{TP+FP}}\) & \(\text{FDR}=\frac{\text{FP}}{\text{FP+TP}}\) \\ \hline \(\text{Recall}=\frac{\text{TP}}{\text{TP+FN}}\) & \(\text{F1\_Score}=\frac{2\left(\text{Precision}\times\text{Recall}\right)}{ \left(\text{Precision}+\text{Recall}\right)}=\frac{2\text{TP}}{2\text{TP+FP+ FN}}\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Summary of classification metric formulas.  
considered a superior metric to MAE when the majority of prediction errors are small and outliers are infrequent or insignificant. However, when the distribution of errors is highly skewed or when the impact of outliers needs to be minimized, MAE might be a more suitable choice. The same when the magnitude of the error is more important than its squared value. In this case, MAE can provide a more intuitive understanding of the model's performance.  
Bias is another commonly used metric for evaluating model performance. Negative bias values indicate underestimation of precipitation, while positive values indicate overestimation [19]. The Pearson correlation coefficient [61] assesses the goodness of fit and linear association between satellite-based precipitation products and observed precipitation. It ranges from 0 to 1, with 1 indicating a perfect fit.  
For spatial analysis and a better understanding of the product's ability to capture spatial precipitation patterns, the Spearman spatial correlation coefficient was used to assess the consistency of spatial distributions between the products and stations [17]. This coefficient, based on rank correlation, provides a measure of similarity in spatial trends. It is calculated at different temporal scales (daily, monthly, and yearly) to evaluate the products' performance (Table 4).