View source: R/Optim_GR2MSemiDistr.R
Optim_GR2MSemiDistr | R Documentation |
Model parameter optimization with the SCE-UA algorithm.
Optim_GR2MSemiDistr(
Data,
Subbasins,
RunIni,
RunEnd,
WarmUp = NULL,
Parameters,
Parameters.Min,
Parameters.Max,
Max.Functions = 5000,
Optimization = "NSE",
No.Optim = NULL
)
Data |
Dataframe with model input's data in airGR format from |
Subbasins |
Subbasins' shapefile. Must contain the following attributes: 'Area' (in km2), 'Region' (in letters), and 'COMID' (identifier number). |
RunIni |
Initial date of the model simulation in 'mm/yyyy' format. |
RunEnd |
Ending date of the model simulation in 'mm/yyyy' format. |
WarmUp |
Number of months for the warm-up period. NULL as default. |
Parameters |
Vector of initial model parameters (X1 and X2) and correction factors of P (fp) and E (fpe) in the following order: c(X1, X2, fp, fpe). In the case of existing more than one 'Region' (e.g. regions A and B) please provide model parameters in the following order: c(X1_A, X1_B, X2_A, X2_B, Fp_a, Fp_B, Fpe_A, Fpe_B). |
Parameters.Min |
Vector of minimum values of GR2M model parameters and correction factors in the following order: c(X1_min, X2_min, fp_min, fpe_min). |
Parameters.Max |
Vector of maximum values of GR2M model parameters and correction factors in the following order: c(X1_max, X2_max, fp_max, fpe_max). |
Max.Functions |
Maximum number of function evaluation for optimization. 5000 as default. |
Optimization |
Objective function for optimization (NSE, KGE, or RMSE). |
No.Optim |
Regions not to be optimized. NULL as default. |
List of optimal GR2M model parameters for each 'Region'.
Param: Best set of GR2M model parameters (sorted by 'Region').
Value: Final value of the objective function.
Llauca H, Lavado-Casimiro W, Montesinos C, Santini W, Rau P. PISCO_HyM_GR2M: A Model of Monthly Water Balance in Peru (1981–2020). Water. 2021; 13(8):1048. https://doi.org/10.3390/w13081048
# Optimize GR2M model parameters for a single 'Region' using the KGE metric
optim <- Optim_GR2MSemiDistr(Data=data,
Subbasins=roi,
RunIni='01/1981',
RunEnd='12/2002',
WarmUp=36,
Parameters=c(1000, 1, 1, 1),
Parameters.Min=c(1, 0.01, 0.8, 0.8),
Parameters.Max=c(2000, 2, 1.2, 1.2),
Max.Functions=1000,
Optimization='KGE')
best_param <- optim$Param
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.