Learn R Programming

RPhosFate (version 2.0.1)

autoCalibrate,RPhosFate-method: One dimensional automatic model calibration

Description

Automatically calibrates the model with the help of a combination of golden section search and successive parabolic interpolation.

Usage

# S4 method for RPhosFate
autoCalibrate(
  x,
  substance,
  col,
  interval,
  metric,
  tol = min(interval) * 0.1,
  parameter = NULL
)

Value

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

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.

interval

A numeric vector specifying the end-points of the interval to be searched.

metric

A character string specifying the metric to optimise. See calibrationQuality for available metrics.

tol

A numeric scalar specifying the desired accuracy of the parameter used for optimisation (not the metric).

parameter

By default, SS are calibrated utilising the overland deposition rate and all other substances are calibrated utilising their respective enrichment ratio. This argument can be used to specify a dedicated parameter utilised for calibration via a character string: "ns_dep_ovl" for overland or "ns_dep_cha" for channel deposition rate.

See Also

snapGauges, optimize

Examples

Run this code
# \donttest{
# 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 <- autoCalibrate(
  x,
  "SS",
  col = "SS_load",
  interval = c(1e-3, 2e-3),
  metric = "KGE"
)# }

Run the code above in your browser using DataLab