Calibration Workflow#
[workflow].mode = "calibration" runs a parameter-estimation campaign. Instead of
executing one fixed simulation, HydroModPy repeatedly proposes parameter
values, runs candidate simulations, scores them, and records the calibration
history.
Use it when the question is: “Which parameter values best explain the observations or synthetic targets?”
Functional Role#
The calibration workflow sits on top of the simulation workflow:
base configuration
-> prepare reusable context
-> ask optimizer for parameters
-> inject parameter values
-> run candidate simulation
-> extract observable(s)
-> compute objective
-> tell optimizer result
-> persist calibration history
-> optionally promote best runs
It is appropriate for:
estimating hydraulic conductivity, storage, boundary conductance, or other exposed model parameters;
comparing optimization methods;
twin experiments with synthetic observations;
calibration diagnostics and reporting.
Typical Command#
hmp run examples/projects/02_nancon_watershed/run_calibration_k.toml
Reference examples:
examples/projects/01_calibration/project.tomlexamples/projects/02_nancon_watershed/run_calibration_k.tomlcalibration pages under Calibration Benchmarks
Representative Results#



Pick A Method#
The [calibration].method field selects the optimizer. save_runs
controls disk cost; best_n keeps every trial in the DuckDB trace but
only promotes the top trials to full Zarr / Parquet stores.
Method |
Typical budget |
Determinism |
When to pick it |
|---|---|---|---|
|
product of |
yes |
1-2 parameters, exhaustive sweep |
|
50-200 |
seed-dependent |
General default, adapts as it explores |
|
100-500 |
seed-dependent |
3+ continuous parameters |
|
100-500 |
seed-dependent |
Robust evolutionary alternative |
|
50-100 |
partial |
Local refinement near a known optimum |
Minimal Shape#
[workflow]
mode = "calibration"
base_config = "project.toml"
[simulation]
name = "nancon_calibration_k"
[simulation.time]
start_datetime = "2000-01-01"
end_datetime = "2002-12-31"
step_value = "1 month"
[[simulation.process]]
id = "flow_main"
type = "flow"
solvers = ["modflow_nwt"]
[calibration]
method = "optuna"
max_iter = 40
batch_size = 1
save_runs = "best_n"
save_best_n = 3
seed = 42
objective = "kge"
variable = "discharge"
[calibration.parameters.K]
bounds = [1e-6, 1e-3]
transform = "log"
prior = "log_uniform"
path = "flow.param.K.field.value"
units = "m/s"
Important Parameters#
Section / field |
Role |
Practical guidance |
|---|---|---|
|
Selects the calibration launcher. |
Must be |
|
Holds the fixed model configuration. |
Keep geometry, solver family, and non-calibrated parameters in the base file. |
|
Defines each candidate run window and process. |
Calibration still needs a valid forward simulation definition. |
|
Selects optimizer or sampler. |
|
|
Number of candidate evaluations. |
Keep small for smoke tests; increase for production calibration. |
|
Number of suggestions per ask. |
Current examples usually use |
|
Controls persistence cost. |
|
|
Metric optimized by the default objective. |
Use |
|
Declares bounds, transform, prior, and target config path. |
The |
|
Optional explicit observable declarations. |
Use for point, cell, or boundary outputs in richer calibration cases. |
|
Optional composite objective blocks. |
Use when several observables or weighted metrics must be combined. |
Parameter Declaration Example#
[calibration.parameters.K]
bounds = [1e-6, 1e-3]
transform = "log"
prior = "log_uniform"
path = "flow.param.K.field.value"
units = "m/s"
Use transform = "log" for strictly positive parameters spanning several
orders of magnitude. Use mode = "scale" only when the sampled value should
multiply an existing baseline rather than replace it.
Persistence Strategy#
|
What is stored |
When to use it |
|---|---|---|
|
Calibration history, no full candidate stores. |
Fast exploratory search. |
|
History plus full outputs for the top |
Recommended default for practical calibration. |
|
Every candidate becomes a full persisted simulation. |
Debugging, small synthetic benchmarks, or audit-heavy studies. |
Outputs To Inspect#
After a calibration run, inspect:
configuration figure, so the inverse setup is explicit before reading scores;
objective history or trace, to see convergence and failed regions;
best parameter values;
posterior or distribution figure when the method is distribution-valued;
objective landscape or pairwise projection, to understand where candidates concentrate;
promoted best-run outputs if
save_runs = "best_n"or"all".
Next Pages#
Calibration for the inverse-problem formulation and method notes.
Calibration Architecture for the engine internals and runtime classes.
Calibration Benchmarks for stable benchmark pages with posteriors, traces, and objective landscapes.
How To Read Gallery, Comparison, and Validation Pages for reading the generated result pages.