Decentralize criterion logic for easier extension of 'ErrorCrit' functions
Description
Currently, the logic for setting CritBestValue
and Multiplier
depending on the error criterion (e.g. RMSE, NSE, KGE, etc.) is handled inside the internal .ErrorCrit()
function. This approach makes extensions and maintenance less generic, as new criteria would require central modification.
Proposal
Move the definition of CritBestValue
and Multiplier
to the individual criterion calculation functions: ErrorCrit_KGE
, ErrorCrit_KGE2
, ErrorCrit_NSE
, and CreateErrorCrit_GAPX
. This way, each function is responsible for its own logic regarding what constitutes a "best" value and the necessary multiplier.
Benefits
- Improves modularity and extensibility, making it easier to add new error criteria without modifying the core logic
- Reduces central conditional code and clarifies the purpose of each
ErrorCrit_*
function