Skip to contents

Transforms model parameters to the unit hypercube [0, 1] and back, depending on the specified direction. For airGR models, the corresponding transformation functions from the airGR package are used. For other models, a min-max normalization approach is applied using norm_minmax.

Usage

transfo_param(
  param,
  direction,
  model,
  snow_module = NULL,
  add_snow_par = FALSE,
  cal_parameter = default_cal_par
)

Arguments

param

A numeric vector of model parameters.

direction

A character string indicating the direction of transformation: "RT" (real to transformed) or "TR" (transformed to real).

model

A character string specifying the hydrological model (e.g., "GR4J", "TUW", "CemaNeigeGR4J"). For a complete list see table in vignette("model_overview").

snow_module

Optional. A character string specifying the snow module to be included in the transformation (currently "CemaNeige" and "TUWsnow").

add_snow_par

Logical. If TRUE, snow module parameters are included in the transformation. Default is FALSE.

cal_parameter

A list containing calibration parameter bounds (lower and upper) for each model and snow module. Defaults to default_cal_par.

Value

A numeric vector of transformed or re-transformed parameters.

Details

Model combinations such as "CemaNeigeGR4J" are supported. Parameters for snow modules can also be included and transformed independently.

Note

  1. CemaNeigeHyst is not yet implemented.

  2. The airGR transformation functions require the airGR package to be installed.

  3. Future versions may include an option to bypass airGR transformations entirely.

Examples

# Scale a parameter set for model "TUW" to [0,1] and back
param <- c(1, 2, 3, -1, 1, 1, 200, 10, 1, 15, 100, 50, 2, 15, 50)
scaled <- transfo_param(param, "RT", "TUW")
rescaled <- transfo_param(scaled, "TR", "TUW")