ErmCalibration¶
Calibrates the parameters of the water budget model with Particle Swarm Optimisation: a swarm of pParticlesNum candidate parameter sets moves through the parameter space for pPsoIterations iterations, each candidate attracted by its own best position and by the best one of the swarm. Each candidate is evaluated by running the model over the calibration period and comparing the simulated discharge with the observed one at the stream gauges, with the Kling-Gupta efficiency (KGE): 1 is a perfect agreement.
The first pSpinUpDays of the period only warm up the storages of the model and are not evaluated. The calibration runs pParticlesNum × pPsoIterations simulations, in parallel on pCalibrationThreadCount threads: on long periods it can take hours.
At the end, the best parameters and their KGE are reported in the log. These are the 18 parameters, in the order they are reported and accepted by ErmSimulation, with the ranges explored by the calibration:
# |
Parameter |
Unit |
Range |
|---|---|---|---|
1 |
adjustment coefficient for the rain measurements |
- |
0.8 – 1.5 |
2 |
adjustment coefficient for the snow measurements |
- |
0.8 – 1.5 |
3 |
melting temperature |
°C |
-1 – 3 |
4 |
combined melting factor |
mm/°C/day |
0.0001 – 2 |
5 |
freezing factor |
mm/°C/day |
0.0001 – 1 |
6 |
coefficient for the maximum liquid water in the snowpack |
- |
0.001 – 0.5 |
7 |
canopy outflow coefficient |
- |
0.1 – 0.9 |
8 |
partitioning coefficient of the free throughfall |
- |
0.5 – 0.98 |
9 |
maximum root zone storage |
mm |
40 – 250 |
10 |
maximum percolation rate of the root zone |
- |
0.000001 – 3 |
11 |
exponent of the non-linear reservoir of the root zone |
- |
0.8 – 1 |
12 |
degree of spatial variability of the soil moisture capacity |
- |
0.5 – 3 |
13 |
maximum runoff storage |
mm |
5 – 100 |
14 |
coefficient of the non-linear runoff reservoir |
- |
0.000001 – 5 |
15 |
exponent of the non-linear runoff reservoir |
- |
0.9 – 1 |
16 |
maximum groundwater storage |
mm |
100 – 1000 |
17 |
coefficient of the non-linear groundwater reservoir |
- |
0.0000005 – 2 |
18 |
exponent of the non-linear groundwater reservoir |
- |
0.95 – 1 |
Parameters¶
Sixth step of the ERM/GeoFrame water budget workflow: calibrates the 18 parameters of the water budget model against the observed discharge, with Particle Swarm Optimisation. The best parameters found and their score are reported at the end.
Toolbox folder: GeoFrame
Status: Certified
Keywords: ERM, GeoFrame, calibration, PSO, water budget
Authors: Andrea Antonello
Class: org.hortonmachine.hmachine.geoframe.ermworkflow.ErmCalibration
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
GeoPackage file |
The GeoFrame database, with all the inputs prepared by the previous steps of the workflow. |
||
|
String |
Start of the simulated period. Format: yyyy-MM-dd HH:mm:ss, in UTC. |
||
|
String |
End of the simulated period. Format: yyyy-MM-dd HH:mm:ss, in UTC. |
||
|
int |
min |
|
Length of the time step: 60 for hourly data, 1440 for daily data. |
|
int |
days |
|
Days at the start of the period used only to warm up the model storages, excluded from the evaluation against the observations. |
|
boolean |
|
If true, model state is written to the database at each time step. |
|
|
int |
|
Number of PSO iterations. |
|
|
int |
|
Number of PSO particles. |
|
|
double |
|
PSO cognitive acceleration constant (c1). |
|
|
double |
|
PSO social acceleration constant (c2). |
|
|
double |
|
PSO initial inertia weight (w0). |
|
|
double |
|
PSO inertia weight decay factor. |
|
|
int |
|
Number of parallel threads for calibration. |
|
|
one of: |
|
Measure of the agreement between simulated and observed discharge: KGE, the Kling-Gupta efficiency (Gupta et al., 2009). |
|
|
boolean |
|
If true, the progress of the calibration is reported in detail. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
double[] |
The best parameters found, in the order expected by the simulation. |
|
|
double |
The score of the best parameters, for the chosen measure of agreement. |
References
Kennedy, J., Eberhart, R. (1995). Particle swarm optimization. Proceedings of the IEEE International Conference on Neural Networks, 1942-1948.
Gupta, H. V., Kling, H., Yilmaz, K. K., Martinez, G. F. (2009). Decomposition of the mean squared error and NSE performance criteria: implications for improving hydrological modelling. Journal of Hydrology, 377(1-2), 80-91.
Example¶
import org.hortonmachine.hmachine.geoframe.ermworkflow.ErmCalibration;
// the folder containing the input data: change it to yours
var workspace = "/data/COURSE_WATER/"
var cal = new ErmCalibration();
cal.inGeopackagePath = workspace + "outputs/geoframe_data.gpkg"
cal.inFromTimestamp = "2018-01-01 01:00:00"
cal.inToTimestamp = "2020-12-31 01:00:00"
cal.pTimeStepMinutes = 60*24 // daily
// days to get get the model up and running
cal.pSpinUpDays = 365
// Particle swarming calibration parameters
cal.pPsoIterations = 300
cal.pParticlesNum = 50
// write
cal.doWriteState = false
cal.printDebugInfo = false
cal.process()
The calibration run in the Geoscript Console: the log shows the best cost of the swarm at each iteration and, at the end, the best parameters found. They can be copied into the simulation script.¶