autoCalibrate2-RPhosFate-method function

Two dimensional automatic model calibration

Two dimensional automatic model calibration

Automatically calibrates the model with the help of a general-purpose optimisation function. In contrast to autoCalibrate, this method always utilises the overland and channel deposition rate at the same time and never the respective enrichment ratio for calibration. Beware of local optima and parameters approximately within the convergence tolerance of interval end-points.

## S4 method for signature 'RPhosFate' autoCalibrate2( x, substance, col, metric, method = "Nelder-Mead", lower = 0, upper = 0.1, control = list(fnscale = if (metric %in% c("NSE", "mNSE", "KGE")) -1 else 1) )

Arguments

  • x: An S4 RPhosFate river catchment object.
  • substance: A character string specifying the substance to calculate.
  • col: A character string specifying the calibration data column with the respective substance river loads.
  • metric: A character string specifying the metric to optimise. See calibrationQuality for available metrics.
  • method: A character string specifying the utilised optimisation method. See optim for further information (use autoCalibrate instead of method "Brent").
  • lower: A numeric scalar or vector specifying the lower end-point(s) of the interval(s) to be searched.
  • upper: A numeric scalar or vector specifying the upper end-point(s) of the interval(s) to be searched.
  • control: A list of control parameters passed on to optim. See optim for further information.

Returns

An S4 RPhosFate river catchment object and side effects in the form of raster files.

Examples

# temporary demonstration project copy cv_dir <- demoProject() # load temporary demonstration project x <- RPhosFate( cv_dir = cv_dir, ls_ini = TRUE ) # presupposed method calls x <- firstRun(x, "SS") x <- snapGauges(x) x <- autoCalibrate2( x, "SS", col = "SS_load", metric = "KGE", method = "L-BFGS-B", lower = c(1e-3, 0), upper = c(2e-3, 2e-3), control = list(fnscale = -1, parscale = c(1e-3, 1e-3), factr = 1e12) )

See Also

snapGauges

  • Maintainer: Gerold Hepp
  • License: AGPL (>= 3)
  • Last published: 2025-03-22