autoCalibrate2,RPhosFate-method {RPhosFate}R Documentation

Two dimensional automatic model calibration

Description

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.

Usage

## 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.

Value

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

See Also

snapGauges

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 = "NSE",
  method = "L-BFGS-B",
  lower = c(10e-4, 0),
  upper = c(20e-4, 20e-4),
  control = list(fnscale = -1, parscale = c(1e-3, 1e-3), factr = 1e12)
)


[Package RPhosFate version 1.0.4 Index]