Learn R Programming

airGR (version 1.7.6)

Calibration_Michel: Calibration algorithm that optimises the error criterion selected as objective function using the Irstea procedure described by C. Michel

Description

Calibration algorithm that optimises the error criterion selected as objective function.

The algorithm combines a global and a local approach. First, a screening is performed using either a rough predefined grid or a list of parameter sets. Then a steepest descent local search algorithm is performed, starting from the result of the screening procedure.

Usage

Calibration_Michel(InputsModel, RunOptions, InputsCrit, CalibOptions,
                   FUN_MOD, FUN_CRIT, FUN_TRANSFO = NULL, verbose = TRUE, ...)

Value

[list] list containing the function outputs organised as follows:

$ParamFinalR [numeric] parameter set obtained at the end of the calibration
$CritFinal [numeric] error criterion selected as objective function obtained at the end of the calibration
$NIter [numeric] number of iterations during the calibration
$NRuns [numeric] number of model runs done during the calibration
$HistParamR [numeric] table showing the progression steps in the search for optimal set: parameter values
$HistCrit [numeric] table showing the progression steps in the search for optimal set: criterion values
$MatBoolCrit [boolean] table giving the requested and actual time steps over which the model is calibrated
$CritName [character] name of the calibration criterion used as objective function
$CritBestValue[numeric] theoretical best criterion value

Arguments

InputsModel

[object of class InputsModel] see CreateInputsModel for details

RunOptions

[object of class RunOptions] see CreateRunOptions for details

InputsCrit

[object of class InputsCrit] see CreateInputsCrit for details

CalibOptions

[object of class CalibOptions] see CreateCalibOptions for details

FUN_MOD

[function] hydrological model function (e.g. RunModel_GR4J, RunModel_CemaNeigeGR4J)

FUN_CRIT

(deprecated) [function] error criterion function (e.g. ErrorCrit_RMSE, ErrorCrit_NSE)

FUN_TRANSFO

(optional) [function] model parameters transformation function, if the FUN_MOD used is native in the package FUN_TRANSFO is automatically defined

verbose

(optional) [boolean] boolean indicating if the function is run in verbose mode or not, default = TRUE

...

(optional) arguments to pass to RunModel

Author

Laurent Coron, Claude Michel, Charles Perrin, Thibault Mathevet, Olivier Delaigue, Guillaume Thirel, David Dorchies

Details

A screening is first performed either based on a rough predefined grid (considering various initial values for each parameter) or from a list of initial parameter sets.
The best set identified in this screening is then used as a starting point for the steepest descent local search algorithm.
For this search, since the ranges of parameter values can be quite different, simple mathematical transformations are applied to parameters to make them vary in a similar range and get a similar sensitivity to a predefined search step. This is done using the TransfoParam functions.
During the steepest descent method, at each iteration, we start from a parameter set of NParam values (NParam being the number of free parameters of the chosen hydrological model) and we determine the 2*NParam-1 new candidates by changing one by one the different parameters (+/- search step).
All these candidates are tested and the best one kept to be the starting point for the next iteration. At the end of each iteration, the the search step is either increased or decreased to adapt the progression speed. A composite step can occasionally be done.
The calibration algorithm stops when the search step becomes smaller than a predefined threshold.

References

Michel, C. (1991), Hydrologie appliquée aux petits bassins ruraux. Hydrology handbook (in French), Cemagref, Antony, France.

See Also

Calibration, RunModel_GR4J, TransfoParam, ErrorCrit_RMSE, CreateInputsModel, CreateRunOptions, CreateInputsCrit, CreateCalibOptions.

Examples

Run this code
library(airGR)

## loading catchment data
data(L0123001)

## preparation of InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR,
                                 Precip = BasinObs$P, PotEvap = BasinObs$E)

## calibration period selection
Ind_Run <- seq(which(format(BasinObs$DatesR, format = "%Y-%m-%d")=="1990-01-01"),
               which(format(BasinObs$DatesR, format = "%Y-%m-%d")=="1999-12-31"))

## preparation of RunOptions object
RunOptions <- CreateRunOptions(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel,
                               IndPeriod_Run = Ind_Run)

## calibration criterion: preparation of the InputsCrit object
InputsCrit <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
                               RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])

## preparation of CalibOptions object
CalibOptions <- CreateCalibOptions(FUN_MOD = RunModel_GR4J, FUN_CALIB = Calibration_Michel)

## calibration
OutputsCalib <- Calibration_Michel(InputsModel = InputsModel, RunOptions = RunOptions,
                                 InputsCrit = InputsCrit, CalibOptions = CalibOptions,
                                 FUN_MOD = RunModel_GR4J)

## simulation
Param <- OutputsCalib$ParamFinalR
OutputsModel <- RunModel_GR4J(InputsModel = InputsModel,
                              RunOptions = RunOptions, Param = Param)

## results preview
plot(OutputsModel, Qobs = BasinObs$Qmm[Ind_Run])

## efficiency criterion: Nash-Sutcliffe Efficiency
InputsCrit  <- CreateInputsCrit(FUN_CRIT = ErrorCrit_NSE, InputsModel = InputsModel,
                                RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_NSE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)

## efficiency criterion: Kling-Gupta Efficiency
InputsCrit  <- CreateInputsCrit(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel,
                                RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run])
OutputsCrit <- ErrorCrit_KGE(InputsCrit = InputsCrit, OutputsModel = OutputsModel)

Run the code above in your browser using DataLab