CreateInputsCrit_Lavenne: Creation of the InputsCrit object for Lavenne Criterion

View source: R/CreateInputsCrit_Lavenne.R

CreateInputsCrit_LavenneR Documentation

Creation of the InputsCrit object for Lavenne Criterion

Description

Creation of the InputsCrit object required to the ErrorCrit function. This function defines a composite criterion based on the formula proposed by Lavenne et al. (2019).

Usage

CreateInputsCrit_Lavenne(FUN_CRIT = ErrorCrit_KGE,
                         InputsModel,
                         RunOptions,
                         Obs,
                         VarObs = "Q",
                         AprParamR,
                         AprCrit = 1,
                         k = 0.15,
                         BoolCrit = NULL,
                         transfo = "sqrt",
                         epsilon = NULL)

Arguments

FUN_CRIT

[function] error criterion function (e.g. ErrorCrit_KGE, ErrorCrit_NSE). Default ErrorCrit_KGE

InputsModel

[object of class InputsModel] see CreateInputsModel for details

RunOptions

[object of class RunOptions] see CreateRunOptions for details

Obs

[numeric (atomic or list)] series of observed variable ([mm/time step] for discharge or SWE, [-] for SCA)

VarObs

(optional) [character (atomic or list)] names of the observed variable ("Q" by default, or one of "SCA", "SWE")

AprParamR

[numeric] a priori parameter set from a donor catchment

AprCrit

(optional) [numeric] performance criterion of the donor catchment (1 by default)

k

(optional) [numeric] coefficient used for the weighted average between FUN_CRIT and the gap between the optimised parameter set and an a priori parameter set calculated with the function produced by CreateErrorCrit_GAPX

BoolCrit

(optional) [boolean] boolean (the same length as Obs) giving the time steps to consider in the computation (all time steps are considered by default. See details)

transfo

(optional) [character] name of the transformation applied to the variables (e.g. "", "sqrt", "log", "inv", "sort", "boxcox" or a numeric value for power transformation for FUN_CRIT. Default value is "sqrt". See details of CreateInputsCrit

epsilon

(optional) [numeric] small value to add to all observations and simulations for FUN_CRIT when "log" or "inv" transformations are used [same unit as Obs]. See details of CreateInputsCrit

Details

The parameters FUN_CRIT, Obs, VarObs, BoolCrit, transfo, and epsilon must be used as they would be used for CreateInputsCrit in the case of a single criterion.

ErrorCrit_RMSE cannot be used in a composite criterion since it is not a unitless value.

CreateInputsCrit_Lavenne creates a composite criterion in respect with Equations 1 and 2 of de Lavenne et al. (2019).

Value

[list] object of class InputsCrit containing the data required to evaluate the model outputs (see CreateInputsCrit for more details).

CreateInputsCrit_Lavenne returns an object of class Compo.

Items Weights of the criteria are respectively equal to k and k * max(0, AprCrit).

To calculate the Lavenne criterion, it is necessary to use the ErrorCrit function as for any other composite criterion.

Author(s)

David Dorchies

References

de Lavenne, A., Andréassian, V., Thirel, G., Ramos, M.-H. and Perrin, C. (2019). A Regularization Approach to Improve the Sequential Calibration of a Semidistributed Hydrological Model. Water Resources Research 55, 8821–8839. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1029/2018WR024266")}

See Also

RunModel, CreateInputsModel, CreateRunOptions, CreateCalibOptions, ErrorCrit

Examples

library(airGR)

## loading catchment data
data(L0123001)

## preparation of the 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)

## simulation
Param <- c(X1 = 257.238, X2 = 1.012, X3 = 88.235, X4 = 2.208)
OutputsModel <- RunModel_GR4J(InputsModel = InputsModel,
                              RunOptions = RunOptions, Param = Param)

## The "a priori" parameters for the Lavenne formula
AprParamR <- c(X1 = 157, X2 = 0.8, X3 = 100, X4 = 1.5)

## Single efficiency criterion: GAPX with a priori parameters
IC_DL <- CreateInputsCrit_Lavenne(InputsModel = InputsModel,
                                    RunOptions = RunOptions,
                                    Obs = BasinObs$Qmm[Ind_Run],
                                    AprParamR = AprParamR)
str(ErrorCrit(InputsCrit = IC_DL, OutputsModel = OutputsModel))

airGR documentation built on Oct. 26, 2023, 9:07 a.m.