[[calibration.phases]]#

One stage of a calibration that runs in several.

  • calibration.phases [[array of tables]] · optional · 25 user keys

Repeat the table: one [[calibration.phases]] block per item.

name = ‹string›Phase identifier, unique in the calibration and used in the session directory and in the report. required experimental
Path
calibration.phases.name
Accepted
string
parameters = ‹list of string›Names of the calibration parameters this phase may move. required at least 1 item experimental
Path
calibration.phases.parameters
More

Every other parameter keeps the value it entered the phase with.

Accepted
list of string
Valid range
at least 1 item (refused outside)
# description = ""What this phase calibrates and against what, in one sentence. experimental
Path
calibration.phases.description
Accepted
string
# method = ‹string›Optimization method for this phase only. experimental
Path
calibration.phases.method
More

Unset, the phase runs the method [calibration] writes; failing that it follows from what the phase scores: 'bisection' when the phase 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. hmp calibrate --list-phases prints the method and where it comes from. Write it to depart from that choice, and whenever method_options are given and [calibration] writes no method. 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.

Accepted
string
# max_trials = ‹integer or "auto"›Maximum number of evaluations for this phase. > 0 experimental
Path
calibration.phases.max_trials
More

Unset, the phase takes the max_trials of [calibration]. 'auto' lets an engine that counts its evaluations size it: the bisection budgets its worst case, the grid, the Latin hypercube and its zoomed form their design, and each refuses before the first solve a number below its nominal count (see [calibration].max_trials). Any other engine gets 100 from 'auto', and no extension when it spends them before its stopping rule.

Values
  • "auto"
Accepted
integer or "auto"
Valid range
> 0 (refused outside)
Was
calibration.phases.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.phases.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 phase takes the precision of [calibration] when its engine stops on one and the phase writes no stopping option of its own, else the engine's default applies. Written here, an engine that stops on its budget rather than on a precision refuses it rather than ignore it.

Accepted
number
Valid range
> 0 (refused outside)
Unit
-
Was
calibration.phases.tolerance
# batch_size = ‹integer›Suggestions drawn per ask, at least parallel. - >= 1 experimental
Path
calibration.phases.batch_size
More

Unset, the phase takes the batch_size of [calibration].

Accepted
integer
Valid range
>= 1 (refused outside)
Unit
-
# parallel = ‹integer›Trials of this phase solved side by side, each in its own folder. - >= 1 experimental
Path
calibration.phases.parallel
More

Unset, the phase takes the parallel of [calibration], which also reaches the phases a protocol writes.

Accepted
integer
Valid range
>= 1 (refused outside)
Unit
-
# bounds = ‹table { key = list of number }›[low, high] physical bounds this phase searches a parameter between, as {parameter = [low, high]}, in the unit the parameter declares. experimental
Path
calibration.phases.bounds
More

Only parameters the phase moves, and every interval has to lie inside the bounds of [calibration.parameters.<name>] (or the range the field annotates when the section writes none): a phase narrows a search, it never widens it. A parameter left out keeps the bounds of the section. hmp calibrate --list-phases prints them.

Accepted
table { key = list of number }
# outputs = []Names of the calibration outputs this phase scores on. experimental
Path
calibration.phases.outputs
More

Empty means every declared output.

Accepted
list of string
# objective_blocks = []Objective blocks this phase evaluates. experimental
Path
calibration.phases.objective_blocks
More

Empty means every declared block. A list names them and keeps their declared weight. A table gives each named block the phase's own share instead, {block = share}, normalised to sum to one like a block's weight already is; every key must be a declared block, and every share must be positive.

Accepted
list of string or table { key = number }
# variable = ‹string›Name of the simulated variable, or of a [calibration.outputs] entry, that objective scores when this phase uses no objective block. experimental
Path
calibration.phases.variable
More

Unset, the variable of [calibration] applies.

See
calibration.outputs
Accepted
string
# objective = ‹"rmse" | "nse" | "kge" | "mae" | "nse_log" | "nse_delta" | "nse_seasonal" | "reservoir" | "distance_gap" | "distance_mean" | "bfi_error"›Metric scoring this phase's single simulated series, when the phase does not use objective blocks. experimental
Path
calibration.phases.objective
More

Same vocabulary as a block's 'metric'.

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"
# method_options = ‹table { key = any value }›Options of this phase's method, named as that method names them: sweep_points for 'bisection', points_per_dim for 'grid', sampler for 'optuna'. experimental
Path
calibration.phases.method_options
More

They belong to one method, so a phase that gives them writes method beside them, or runs the method [calibration] writes. Unset, the phase takes the method_options of [calibration] when it runs the method that section writes, and none otherwise; an empty table states that it takes none. A key the method does not take is refused when the file loads. hmp check names the phase.

Accepted
table { key = any value }
Was
calibration.phases.optimizer_kwargs
# regime = ‹"steady" | "transient" | "soil"›Flow regime this phase runs, a property of the model and not of the search. experimental
Path
calibration.phases.regime
More

'steady' is one period over steady_window, by default the extent of [simulation.time]. 'transient' is the project's own time grid. 'soil' runs no solver: it sets ru to the capacity that closes recharge plus runoff against the gauge, on the soil reservoir alone, and holds it for the phases after it. Unset, the phase runs the model as the project and its overrides declare it.

Values
  • "steady" : One period over steady_window, so the recharge over it averages to its mean. A steady solve carries no storage.
  • "transient" : The project's time grid, with only the regime restated.
  • "soil" : No solver: ru closes the water budget of the soil against the gauge, then the next phases calibrate K and Sy with it fixed.
Accepted
"steady" | "transient" | "soil"
# steady_window = ‹table { key = string }›Dates the steady period spans, as {start, end}, when regime = 'steady'. only if regime = "steady" experimental
Path
calibration.phases.steady_window
More

Unset takes the whole [simulation.time] window.

Accepted
table { key = string }
Only if
regime = "steady"
# overrides = {}Configuration values this phase runs with, as dotted paths into the project configuration. experimental
Path
calibration.phases.overrides
More

A phase that gives regime may not write here a path regime writes: that would say the same thing twice.

Accepted
table { key = any value }
# depends_on = ‹string›Name of the phase that must run first. experimental
Path
calibration.phases.depends_on
More

The values it passes on enter this one fixed, except those this phase lists and moves again. When that phase freezes its values and its search stops on its budget before a rule of its own, this phase is refused rather than run on the values of the file.

Accepted
string
# freeze_on_success = truePass the values this phase found to the phases after it. experimental
Path
calibration.phases.freeze_on_success
More

A later phase holds them fixed, unless it lists the parameter: it then moves it again, starting from the passed value when its method accepts a start point. When two phases pass on the same parameter, the later one wins. Success means the search met its own rule or solved every point of its plan, not that its validity indicator is good. A search with no rule of its own (random_search, cma_es) that spends its budget also passes on its best trial, and the phase says it froze the best of a budget-only search. One with a rule that its budget stops first passes nothing on.

Accepted
true | false

calibration.phases.name name Phase identifier, unique in the calibration and used in the session directory and in the report. calibration.phases.description description “” What this phase calibrates and against what, in one sentence. calibration.phases.method method not set Optimization method for this phase only. Unset, the phase runs the method [calibration] writes; failing that it follows from what the phase scores: ‘bisection’ when the phase 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. hmp calibrate –list-phases prints the method and where it comes from. Write it to depart from that choice, and whenever method_options are given and [calibration] writes no method. 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. calibration.phases.max_trials max_trials not set auto - Maximum number of evaluations for this phase. Unset, the phase takes the max_trials of [calibration]. ‘auto’ lets an engine that counts its evaluations size it: the bisection budgets its worst case, the grid, the Latin hypercube and its zoomed form their design, and each refuses before the first solve a number below its nominal count (see [calibration].max_trials). Any other engine gets 100 from ‘auto’, and no extension when it spends them before its stopping rule. calibration.phases.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 phase takes the precision of [calibration] when its engine stops on one and the phase writes no stopping option of its own, else the engine’s default applies. Written here, an engine that stops on its budget rather than on a precision refuses it rather than ignore it. calibration.phases.batch_size batch_size not set - Suggestions drawn per ask, at least ``parallel``. Unset, the phase takes the ``batch_size`` of ``[calibration]``. calibration.phases.parallel parallel not set - Trials of this phase solved side by side, each in its own folder. Unset, the phase takes the ``parallel`` of ``[calibration]``, which also reaches the phases a protocol writes. calibration.phases.parameters parameters Names of the calibration parameters this phase may move. Every other parameter keeps the value it entered the phase with. calibration.phases.bounds bounds not set [low, high] physical bounds this phase searches a parameter between, as {parameter = [low, high]}, in the unit the parameter declares. Only parameters the phase moves, and every interval has to lie inside the bounds of [calibration.parameters.<name>] (or the range the field annotates when the section writes none): a phase narrows a search, it never widens it. A parameter left out keeps the bounds of the section. hmp calibrate –list-phases prints them. calibration.phases.outputs outputs [] Names of the calibration outputs this phase scores on. Empty means every declared output. calibration.phases.objective_blocks objective_blocks [] Objective blocks this phase evaluates. Empty means every declared block. A list names them and keeps their declared weight. A table gives each named block the phase’s own share instead, {block = share}, normalised to sum to one like a block’s weight already is; every key must be a declared block, and every share must be positive. calibration.phases.variable variable not set Name of the simulated variable, or of a [calibration.outputs] entry, that objective scores when this phase uses no objective block. Unset, the variable of [calibration] applies. calibration.phases.objective objective not set 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 this phase’s single simulated series, when the phase does not use objective blocks. Same vocabulary as a block’s ‘metric’. calibration.phases.method_options method_options not set Options of this phase’s method, named as that method names them: sweep_points for ‘bisection’, points_per_dim for ‘grid’, sampler for ‘optuna’. They belong to one method, so a phase that gives them writes method beside them, or runs the method [calibration] writes. Unset, the phase takes the method_options of [calibration] when it runs the method that section writes, and none otherwise; an empty table states that it takes none. A key the method does not take is refused when the file loads. hmp check names the phase. calibration.phases.regime regime not set steady transient soil steady One period over steady_window, so the recharge over it averages to its mean. A steady solve carries no storage. transient The project’s time grid, with only the regime restated. soil No solver: ru closes the water budget of the soil against the gauge, then the next phases calibrate K and Sy with it fixed. Flow regime this phase runs, a property of the model and not of the search. ‘steady’ is one period over steady_window, by default the extent of [simulation.time]. ‘transient’ is the project’s own time grid. ‘soil’ runs no solver: it sets ru to the capacity that closes recharge plus runoff against the gauge, on the soil reservoir alone, and holds it for the phases after it. Unset, the phase runs the model as the project and its overrides declare it. calibration.phases.steady_window steady_window not set Dates the steady period spans, as {start, end}, when regime = ‘steady’. Unset takes the whole [simulation.time] window. calibration.phases.overrides overrides {} Configuration values this phase runs with, as dotted paths into the project configuration. A phase that gives regime may not write here a path regime writes: that would say the same thing twice. calibration.phases.depends_on depends_on not set Name of the phase that must run first. The values it passes on enter this one fixed, except those this phase lists and moves again. When that phase freezes its values and its search stops on its budget before a rule of its own, this phase is refused rather than run on the values of the file. calibration.phases.freeze_on_success freeze_on_success true Pass the values this phase found to the phases after it. A later phase holds them fixed, unless it lists the parameter: it then moves it again, starting from the passed value when its method accepts a start point. When two phases pass on the same parameter, the later one wins. Success means the search met its own rule or solved every point of its plan, not that its validity indicator is good. A search with no rule of its own (random_search, cma_es) that spends its budget also passes on its best trial, and the phase says it froze the best of a budget-only search. One with a rule that its budget stops first passes nothing on.

[calibration.phases.window]#

Dates bounding the samples a metric is computed on.

# start = ‹string›First date scored, ISO 8601. experimental
Path
calibration.phases.window.start
More

Unset means from the first sample.

Accepted
string
# end = ‹string›Last date scored, ISO 8601. experimental
Path
calibration.phases.window.end
More

Unset means up to the last sample.

Accepted
string

calibration.phases.window.start start not set First date scored, ISO 8601. Unset means from the first sample. calibration.phases.window.end end not set Last date scored, ISO 8601. Unset means up to the last sample.

[calibration.phases.uncertainty]#

How wide one phase says its answer is, key by key over [calibration.uncertainty].

# method = ‹"cost_profile" | "multistart" | "linearized"›How this phase's interval is obtained: 'cost_profile', 'multistart' or 'linearized', read as in [calibration.uncertainty] method. experimental
Path
calibration.phases.uncertainty.method
See
calibration.uncertainty
Values
  • "cost_profile" : Reads the range of sampled values whose cost stayed within cost_margin of the best, off the trace of the search. No extra model run.
  • "multistart" : Repeats the whole search restarts times from different starting points and reports the spread of the optima. It can see a second basin.
  • "linearized" : Linearizes the model about the optimum: one extra run per parameter gives a first-order covariance, and with it which parameters trade off.
Accepted
"cost_profile" | "multistart" | "linearized"
# restarts = ‹integer›How many times method='multistart' repeats this phase's search. - >= 2 experimental
Path
calibration.phases.uncertainty.restarts
Accepted
integer
Valid range
>= 2 (refused outside)
Unit
-
# perturbation = ‹number›Relative step of method='linearized' for this phase, as a fraction of each calibrated value. - > 0 experimental
Path
calibration.phases.uncertainty.perturbation
Accepted
number
Valid range
> 0 (refused outside)
Unit
-
# cost_margin = ‹string›Width of this phase's interval, with its unit: '5%' is a share of the best cost, '75 m' a length, for a phase scored only by network distances. % or m experimental
Path
calibration.phases.uncertainty.cost_margin
More

Unset here and in [calibration.uncertainty], one mesh cell for a phase scored only by network distances, five per cent of the best cost otherwise.

Accepted
string
Unit
% or m
Was
calibration.phases.uncertainty.tolerance, calibration.phases.uncertainty.mode

calibration.phases.uncertainty.method method not set cost_profile multistart linearized cost_profile Reads the range of sampled values whose cost stayed within cost_margin of the best, off the trace of the search. No extra model run. multistart Repeats the whole search restarts times from different starting points and reports the spread of the optima. It can see a second basin. linearized Linearizes the model about the optimum: one extra run per parameter gives a first-order covariance, and with it which parameters trade off. How this phase’s interval is obtained: ‘cost_profile’, ‘multistart’ or ‘linearized’, read as in [calibration.uncertainty] method. calibration.phases.uncertainty.restarts restarts not set - How many times method=’multistart’ repeats this phase’s search. calibration.phases.uncertainty.perturbation perturbation not set - Relative step of method=’linearized’ for this phase, as a fraction of each calibrated value. calibration.phases.uncertainty.cost_margin cost_margin not set % or m Width of this phase’s interval, with its unit: ‘5%’ is a share of the best cost, ‘75 m’ a length, for a phase scored only by network distances. Unset here and in [calibration.uncertainty], one mesh cell for a phase scored only by network distances, five per cent of the best cost otherwise.