Learn R Programming

airGRteaching (version 0.3.3)

CalGR: Calibration algorithm that optimises the error criterion selected as objective function

Description

Calibration algorithm that optimises the error criterion selected as objective function using the INRAE-HYCAR procedure described by C. Michel

Usage

CalGR(PrepGR, CalCrit = c("NSE", "KGE", "KGE2", "RMSE"),
      WupPer = NULL, CalPer,
      transfo = c("", "sqrt", "log", "inv", "sort"), verbose = TRUE)

Value

[list] object of class CalGR containing:

OptionsCalib

[list] object of class RunOptions (see: CreateRunOptions)

Qobs

[numeric] series of observed discharges [mm/time step]

OutputsCalib

[list] object of class OutputsCalib (see: Calibration)

OutputsModel

[list] object of class OutputsModel (see: RunModel)

TypeModel

[character] name of the function of the hydrological model used

CalCrit

[character] name of the function that computes the error criterion during the calibration step

PeriodModel

[list] $WarmUp: vector of 2 POSIXct values defining the beginning and end of the warm-up period, $Run: vector of 2 POSIXct values defining the beginning and end of the calibration period

Arguments

PrepGR

[object of class PrepGR] see PrepGR for details

CalCrit

[character] name of the objective function (must be one of "NSE", "KGE", "KGE2" or "RMSE")

WupPer

(optional) [character] vector of 2 values to define the beginning and end of the warm-up period ["YYYY-mm-dd" or "YYYY-mm-dd HH:MM:SS"]; [0L] to disable the warm-up period. See details

CalPer

[character] vector of 2 values to define the beginning and end of the calibration period ["YYYY-mm-dd" or "YYYY-mm-dd HH:MM:SS"]

transfo

(optional) [character] name of the transformation transformation applied to discharge for calculating the objective function (must be one of "", "sqrt", "log", "inv" or "sort")

verbose

(optional) [boolean] logical value indicating if the function is run in verbose mode or not

Author

Olivier Delaigue, Guillaume Thirel

Details

WupPer = NULL indicates that, if available, a period of one year immediately present before the CalPer period is used. WupPer = 0L allows to disable the warm up of the model.

See Also

airGRteaching plot and dyplot functions to display static and dynamic plots

airGR CreateRunOptions, CreateInputsCrit, CreateCalibOptions, ErrorCrit_RMSE, ErrorCrit_NSE, ErrorCrit_KGE, ErrorCrit_KGE2, Calibration_Michel functions

Examples

Run this code
library(airGRteaching)

## data.frame of observed data
data(L0123001, package = "airGR")
BasinObs2 <- BasinObs[, c("DatesR", "P", "E", "Qmm", "T")]

## Preparation of observed data for modelling
PREP <- PrepGR(ObsDF = BasinObs2, HydroModel = "GR4J", CemaNeige = TRUE)

## Calibration step
CAL <- CalGR(PrepGR = PREP, CalCrit = "KGE2",
             WupPer = NULL, CalPer = c("1990-01-01", "1993-12-31"))


## Structure of CalGR object
str(CAL)

## Parameter and criterion evolution during
## the steepest descent step of the calibration algorithm
plot(CAL, which = "iter")

## Plot diagnostics
plot(CAL)

## Static plot of observed and simulated time series
plot(CAL, which = "ts")
plot(CAL, which = c("Precip", "Flows"))

## Dynamic plot of observed and simulated time series
dyplot(CAL)

Run the code above in your browser using DataLab