[calibration]#
Top-level [calibration] section.
calibration[table] · optional · 117 user keys, 5 dev or expert- Start a file:
hmp config template --modules calibration(download it), thenhmp check file.toml. Minimal file
# method = ‹string›Optimization method. experimental
- Path
calibration.method- More
Unset, it follows from what the calibration scores: 'bisection' when it moves one parameter in log space and every one of its blocks is signed (distance_gap), since the answer is then a zero to find; 'scipy_nelder_mead' otherwise, a cost to minimise. Write it to depart from that choice, and whenever method_options are given. A phase of [[calibration.phases]] names its own. Built-ins: 'grid' (regular sweep, sized by method_options.points_per_dim), 'lhs' (stratified Latin hypercube, sized by method_options.n_samples), 'lhs_zoom' (Latin hypercubes in turn, each in the zone the trials so far leave open, sized by method_options.levels, one parameter), 'random_search', 'bisection' (root of a signed criterion on one parameter, the stream-network stage), 'optuna' (TPE), 'cma_es', 'scipy_de', 'scipy_nelder_mead' and 'gp_mapping'. An unknown name is refused when the file is read, with the list installed here. Optuna is installed by default; install the calibration extra for cma_es and Optuna's cmaes sampler.
- Accepted
- string
# evaluator = ‹string›What turns one parameter sample into a cost. experimental
- Path
calibration.evaluator- More
Unset runs the HydroModPy pipeline, which is what every calibrated number in this repository was produced with. A string and not an enumeration: the values that resolve depend on what is installed beside HydroModPy, which is how a surrogate or a foreign model is named without a patch. This build also ships 'analytic_bowl', which runs no model and scores a closed-form surface whose minimum is the midpoint of each parameter's interval: it rehearses a whole search -- space, optimizer, stopping rule, report -- in milliseconds, against an answer known in advance.
- Accepted
- string
# max_trials = "auto"Maximum number of evaluations of the search. > 0 experimental
- Path
calibration.max_trials- More
It is the only bound on how long a search runs: no method option counts evaluations of its own. 'auto' lets an engine that counts its evaluations before the first solve size its own budget. Four do. The grid, the Latin hypercube and the zoomed Latin hypercube count their design, one evaluation per point (per point of every level for the zoom), and refuse a smaller number before the first solve, since a sweep cut short is not its design. The bisection counts with d the declared interval in decades, t = log10(1 + rel_tol), S the sweep points (counted as 2 for sweep_points 0), s = d / (S - 1) and E = bracket_expand, a root inside the bounds costs S + ceil(log2(s / t)) and one found after e expansions S + 2e + ceil(log2(1 / t)); 'auto' budgets the largest, 23 on [1e-7, 1e-3] m/s with seven points and one per cent (15 inside the bounds). A number below the nominal count is refused before the first solve, one below the worst case is announced, and a budget that still runs out gets exactly the halvings left, once. Any other engine gets 100 from 'auto' and no extension: a search that spends its budget before its own stopping rule is reported as not converged, and a re-run with a larger max_trials replays the trials already solved from the cache.
- Values
"auto"
- Accepted
- integer or "auto"
- Valid range
- > 0 (refused outside)
- Was
calibration.max_iter
# precision = ‹number›How precisely the search has to pin a parameter before it stops, as a relative precision on the parameter itself: 0.01 asks for one per cent, 0.1 for ten. - > 0 experimental
- Path
calibration.precision- More
On a parameter searched in log space that is a ratio, which is how a conductivity is known in the first place, and it holds wherever the value sits; on any other search space there is no scale on the value to be relative to before the search has one, so it reads as a fraction of the declared interval. Each engine's own stopping option is written from it, so the same number survives a change of engine, and the engine's own option stays available for reproducing a published call verbatim. Unset, the engine's default applies. An engine that stops on its budget rather than on a precision refuses this rather than ignore it.
- Accepted
- number
- Valid range
- > 0 (refused outside)
- Unit
- -
- Was
calibration.tolerance
# batch_size = 1Number of suggestions drawn per ask, at least parallel. - >= 1 experimental
- Path
calibration.batch_size- Accepted
- integer
- Valid range
- >= 1 (refused outside)
- Unit
- -
# parallel = 1Trials solved side by side, each in its own folder, for every phase that sets none of its own. - >= 1 experimental
- Path
calibration.parallel- More
A grid or a random search evaluates its points together; a root search cuts its bracket into parallel + 1 parts; a simplex evaluates the candidates of one step together and keeps the sequential answer, so a width above 4 buys it nothing, and CMA-ES and differential evolution stop at their population. A width above 1 gives each worker process its own copy of the model (about 0.5 GiB, 3 s to start); 1 solves the trials one after the other in this process.
- Accepted
- integer
- Valid range
- >= 1 (refused outside)
- Unit
- -
# reject_water_budget_above = 1.0Percent water-balance discrepancy of the whole model past which a trial is rejected instead of scored. % >= 0 experimental
- Path
calibration.reject_water_budget_above- More
The figure is the one the solver prints for the volume budget of the entire model, not the budget of a single package such as the lake package, which divides by small flows and reads higher. A rejected trial is marked failed, so it is neither ranked nor promoted: part of the water it routed came from nowhere and its cost is not comparable to a run that closed. Default 1.0 (one per cent). Raise it for a transient model whose lake or routed network legitimately sits higher. A TOML file has no null: to switch the gate off write a value no run reaches, such as 1000, or pass None from Python. The worst time step of the run decides, not the last.
- Accepted
- number
- Valid range
- >= 0 (refused outside)
- Unit
- %
# seed = ‹integer›Seed of the random draws of the search (starting points, samples). - experimental
- Path
calibration.seed- More
The same seed with the same file gives the same trials.
- Accepted
- integer
- Unit
- -
# save_runs = "best_n"Which trials become runs once the search ends. experimental
- Path
calibration.save_runs- More
Every trial leaves one line in sessions/<case>/trials.jsonl whatever the mode. 'best_n' promotes the best trial of the last phase to runs/<case>/, the calibrated run, and keeps the save_best_n - 1 next ones under sessions/<case>/trials/<n>/. 'all' keeps every completed trial there. 'none' promotes nothing.
- Values
"none""best_n""all"
- Accepted
- "none" | "best_n" | "all"
# save_best_n = 1Number of trials the 'best_n' mode of save_runs keeps as runs: 1 is the calibrated run alone, under runs/<case>/. - >= 0 experimental
- Path
calibration.save_best_n- Accepted
- integer
- Valid range
- >= 0 (refused outside)
- Unit
- -
# promote_phases = falseAlso promote the best trial of each phase before the last one, under sessions/<case>/phases/<phase>/best/. experimental
- Path
calibration.promote_phases- More
The calibrated run of the case is the best trial of the last phase whatever this says.
- Accepted
- true | false
# objective = "nse"Metric scoring the single simulated series, when no objective block is declared. experimental
- Path
calibration.objective- More
Same vocabulary as a block's 'metric'; typed here so a bad value is reported against the key that was written.
- Values
"rmse": Root-mean-square error, in the observed unit; penalizes large misfits most."nse": Nash-Sutcliffe efficiency against the observed mean; the standard choice for a level or discharge series."kge": Kling-Gupta efficiency, 2009 form (bias as the ratio of sums, variability as the ratio of standard deviations); separates correlation, variability and bias when NSE alone is ambiguous."mae": Mean absolute error, in the observed unit; less sensitive to outliers than RMSE."nse_log": NSE on log-transformed series; weights low flows as heavily as peaks, good for recessions."nse_delta": NSE on the increments of the series rather than its level; a level is an integral and can hide flux errors that compensate, which only its increments show."nse_seasonal": NSE against the seasonal cycle rather than the overall mean; asks whether the model beats climatology."reservoir": Half nse_seasonal plus half nse_delta, built for an impounded level: a plain NSE there is beaten by the seasonal cycle, and the increments are what carry the flux errors."distance_gap": Balances the simulated stream network against the mapped one; zero marks the crossing."distance_mean": Mean spatial offset between simulated and mapped streams; a diagnostic, not a substitute for distance_gap."bfi_error": Distance between the simulated and observed baseflow indices (Wallingford, daily discharge only); asks whether the stream is fed by its aquifer in the right share. Blind to volume and timing, so it goes beside a fit, never alone.
- Accepted
- "rmse" | "nse" | "kge" | "mae" | "nse_log" | "nse_delta" | "nse_seasonal" | "reservoir" | "distance_gap" | "distance_mean" | "bfi_error"
# variable = "head"Name of the simulated variable, or of a [calibration.outputs] entry, that objective scores when no objective block is declared. experimental
- Path
calibration.variable- See
- calibration.outputs
- Accepted
- string
# method_options = {}Options of the method, named as that method names them: points_per_dim for 'grid', sampler for 'optuna', sweep_points for 'bisection'. experimental
- Path
calibration.method_options- More
They belong to one method, so a calibration that gives them writes method beside them. A key the method does not take is refused when the file loads.
- Accepted
- table { key = any value }
- Was
calibration.optimizer_kwargs
# persist_iteration_detail = "summary"How much of each trial's cost the session keeps: 'none' skips component metrics; 'summary' keeps block totals; 'full' also stores per-block raw and normalized costs. experimental
- Path
calibration.persist_iteration_detail- Values
"none""summary""full"
- Accepted
- "none" | "summary" | "full"
# persist_trial_series = trueWrite the simulated and observed series of every point/series output a completed trial scored (discharge at a gauge, head at a well...), as a small Parquet table per trial under the session folder, about 2 kB per trial on the island case. experimental
- Path
calibration.persist_trial_series- More
Network and spatial outputs carry no series and are never written here.
- Accepted
- true | false
# use_cache = trueEnable params_hash content-addressable cache. dev experimental
- Path
calibration.use_cache- Accepted
- true | false
# materialize_candidates = falseWrite a standalone overlay TOML for each candidate under sessions/<case>/candidates/, so a trial can be replayed by hand. dev experimental
- Path
calibration.materialize_candidates- Accepted
- true | false
[calibration]
# method = <string>
# evaluator = <string>
# max_trials = "auto"
# precision = <number>
# batch_size = 1
# parallel = 1
# reject_water_budget_above = 1.0
# seed = <integer>
# save_runs = "best_n"
# save_best_n = 1
# promote_phases = false
# objective = "nse"
# variable = "head"
# method_options = {}
# persist_iteration_detail = "summary"
# persist_trial_series = truecalibration.method method not set Optimization method. Unset, it follows from what the calibration scores: ‘bisection’ when it moves one parameter in log space and every one of its blocks is signed (distance_gap), since the answer is then a zero to find; ‘scipy_nelder_mead’ otherwise, a cost to minimise. Write it to depart from that choice, and whenever method_options are given. A phase of [[calibration.phases]] names its own. Built-ins: ‘grid’ (regular sweep, sized by method_options.points_per_dim), ‘lhs’ (stratified Latin hypercube, sized by method_options.n_samples), ‘lhs_zoom’ (Latin hypercubes in turn, each in the zone the trials so far leave open, sized by method_options.levels, one parameter), ‘random_search’, ‘bisection’ (root of a signed criterion on one parameter, the stream-network stage), ‘optuna’ (TPE), ‘cma_es’, ‘scipy_de’, ‘scipy_nelder_mead’ and ‘gp_mapping’. An unknown name is refused when the file is read, with the list installed here. Optuna is installed by default; install the calibration extra for cma_es and Optuna’s cmaes sampler. calibration.evaluator evaluator not set What turns one parameter sample into a cost. Unset runs the HydroModPy pipeline, which is what every calibrated number in this repository was produced with. A string and not an enumeration: the values that resolve depend on what is installed beside HydroModPy, which is how a surrogate or a foreign model is named without a patch. This build also ships ‘analytic_bowl’, which runs no model and scores a closed-form surface whose minimum is the midpoint of each parameter’s interval: it rehearses a whole search – space, optimizer, stopping rule, report – in milliseconds, against an answer known in advance. calibration.max_trials max_trials “auto” auto - Maximum number of evaluations of the search. It is the only bound on how long a search runs: no method option counts evaluations of its own. ‘auto’ lets an engine that counts its evaluations before the first solve size its own budget. Four do. The grid, the Latin hypercube and the zoomed Latin hypercube count their design, one evaluation per point (per point of every level for the zoom), and refuse a smaller number before the first solve, since a sweep cut short is not its design. The bisection counts with d the declared interval in decades, t = log10(1 + rel_tol), S the sweep points (counted as 2 for sweep_points 0), s = d / (S - 1) and E = bracket_expand, a root inside the bounds costs S + ceil(log2(s / t)) and one found after e expansions S + 2e + ceil(log2(1 / t)); ‘auto’ budgets the largest, 23 on [1e-7, 1e-3] m/s with seven points and one per cent (15 inside the bounds). A number below the nominal count is refused before the first solve, one below the worst case is announced, and a budget that still runs out gets exactly the halvings left, once. Any other engine gets 100 from ‘auto’ and no extension: a search that spends its budget before its own stopping rule is reported as not converged, and a re-run with a larger max_trials replays the trials already solved from the cache. calibration.precision precision not set - How precisely the search has to pin a parameter before it stops, as a relative precision on the parameter itself: 0.01 asks for one per cent, 0.1 for ten. On a parameter searched in log space that is a ratio, which is how a conductivity is known in the first place, and it holds wherever the value sits; on any other search space there is no scale on the value to be relative to before the search has one, so it reads as a fraction of the declared interval. Each engine’s own stopping option is written from it, so the same number survives a change of engine, and the engine’s own option stays available for reproducing a published call verbatim. Unset, the engine’s default applies. An engine that stops on its budget rather than on a precision refuses this rather than ignore it. calibration.batch_size batch_size 1 - Number of suggestions drawn per ask, at least ``parallel``. calibration.parallel parallel 1 - Trials solved side by side, each in its own folder, for every phase that sets none of its own. A grid or a random search evaluates its points together; a root search cuts its bracket into parallel + 1 parts; a simplex evaluates the candidates of one step together and keeps the sequential answer, so a width above 4 buys it nothing, and CMA-ES and differential evolution stop at their population. A width above 1 gives each worker process its own copy of the model (about 0.5 GiB, 3 s to start); 1 solves the trials one after the other in this process. calibration.reject_water_budget_above reject_water_budget_above 1.0 % Percent water-balance discrepancy of the whole model past which a trial is rejected instead of scored. The figure is the one the solver prints for the volume budget of the entire model, not the budget of a single package such as the lake package, which divides by small flows and reads higher. A rejected trial is marked failed, so it is neither ranked nor promoted: part of the water it routed came from nowhere and its cost is not comparable to a run that closed. Default 1.0 (one per cent). Raise it for a transient model whose lake or routed network legitimately sits higher. A TOML file has no null: to switch the gate off write a value no run reaches, such as 1000, or pass None from Python. The worst time step of the run decides, not the last. calibration.seed seed not set - Seed of the random draws of the search (starting points, samples). The same seed with the same file gives the same trials. calibration.save_runs save_runs “best_n” none best_n all Which trials become runs once the search ends. Every trial leaves one line in sessions/<case>/trials.jsonl whatever the mode. ‘best_n’ promotes the best trial of the last phase to runs/<case>/, the calibrated run, and keeps the save_best_n - 1 next ones under sessions/<case>/trials/<n>/. ‘all’ keeps every completed trial there. ‘none’ promotes nothing. calibration.save_best_n save_best_n 1 - Number of trials the ‘best_n’ mode of save_runs keeps as runs: 1 is the calibrated run alone, under runs/<case>/. calibration.promote_phases promote_phases false Also promote the best trial of each phase before the last one, under sessions/<case>/phases/<phase>/best/. The calibrated run of the case is the best trial of the last phase whatever this says. calibration.use_cache use_cache true Enable params_hash content-addressable cache. calibration.objective objective “nse” rmse nse kge mae nse_log nse_delta nse_seasonal reservoir distance_gap distance_mean bfi_error rmse Root-mean-square error, in the observed unit; penalizes large misfits most. nse Nash-Sutcliffe efficiency against the observed mean; the standard choice for a level or discharge series. kge Kling-Gupta efficiency, 2009 form (bias as the ratio of sums, variability as the ratio of standard deviations); separates correlation, variability and bias when NSE alone is ambiguous. mae Mean absolute error, in the observed unit; less sensitive to outliers than RMSE. nse_log NSE on log-transformed series; weights low flows as heavily as peaks, good for recessions. nse_delta NSE on the increments of the series rather than its level; a level is an integral and can hide flux errors that compensate, which only its increments show. nse_seasonal NSE against the seasonal cycle rather than the overall mean; asks whether the model beats climatology. reservoir Half nse_seasonal plus half nse_delta, built for an impounded level: a plain NSE there is beaten by the seasonal cycle, and the increments are what carry the flux errors. distance_gap Balances the simulated stream network against the mapped one; zero marks the crossing. distance_mean Mean spatial offset between simulated and mapped streams; a diagnostic, not a substitute for distance_gap. bfi_error Distance between the simulated and observed baseflow indices (Wallingford, daily discharge only); asks whether the stream is fed by its aquifer in the right share. Blind to volume and timing, so it goes beside a fit, never alone. Metric scoring the single simulated series, when no objective block is declared. Same vocabulary as a block’s ‘metric’; typed here so a bad value is reported against the key that was written. calibration.variable variable “head” Name of the simulated variable, or of a [calibration.outputs] entry, that objective scores when no objective block is declared. calibration.method_options method_options {} Options of the method, named as that method names them: points_per_dim for ‘grid’, sampler for ‘optuna’, sweep_points for ‘bisection’. They belong to one method, so a calibration that gives them writes method beside them. A key the method does not take is refused when the file loads. calibration.persist_iteration_detail persist_iteration_detail “summary” none summary full How much of each trial’s cost the session keeps: ‘none’ skips component metrics; ‘summary’ keeps block totals; ‘full’ also stores per-block raw and normalized costs. calibration.persist_trial_series persist_trial_series true Write the simulated and observed series of every point/series output a completed trial scored (discharge at a gauge, head at a well…), as a small Parquet table per trial under the session folder, about 2 kB per trial on the island case. Network and spatial outputs carry no series and are never written here. calibration.materialize_candidates materialize_candidates false Write a standalone overlay TOML for each candidate under sessions/<case>/candidates/, so a trial can be replayed by hand.
Tables on their own page#
This table holds 122 fields; above 120, each sub-table gets its own page.
[calibration.protocol]Published calibration method this file runs, named instead of retyped.[calibration.window]Dates bounding the samples every metric is computed on: the way to leave a spin-up out, with start = the first date scored.[calibration.validation_window]Dates kept apart from the search, with both bounds.[[calibration.phases]]Stages run one after the other, each calibrating its own parameters and freezing them for the next.[calibration.parameters]Per-parameter declarations (bounds, search_space, sampling, path).[calibration.outputs]Named observables extracted from each candidate run.[[calibration.objective_blocks]]Weighted blocks making up a composite objective.[calibration.aggregate]How several scored targets become one cost: the fewest paired samples a member may be scored on.[calibration.uncertainty]How wide the search reports its own answer to be.