CreateErrorCrit_GAPX.Rd 2.74 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
\encoding{UTF-8}


\name{CreateErrorCrit_GAPX}
\alias{CreateErrorCrit_GAPX}


\title{Creation of the ErrorCrit_GAPX function}


\description{
Function which computes the function \code{ErrorCrit_GAPX}.

The produced function \code{ErrorCrit_GAPX} computes an error criterion based on the GAPX formula proposed by de Lavenne et al. (2019).
}


\usage{
CreateErrorCrit_GAPX(FUN_TRANSFO)
}


\arguments{
\item{FUN_TRANSFO}{[function] The parameter transformation function used with the model}
}


\value{
  a function \code{ErrorCrit_GAPX} embedding the parameter transformation function used with the model.
}

\details{
In addition to the criterion value, the function outputs include a multiplier (-1 or +1) which allows
the use of the function for model calibration: the product CritValue * Multiplier is the criterion to be minimised
(Multiplier = -1 for NSE).
}

\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)

## Creation of the ErrorCrit GAPX function
ErrorCrit_GAPX <- CreateErrorCrit_GAPX(TransfoParam_GR4J)

## The "a priori" parameters for GAPX
AprParamR <- c(X1 = 157, X2 = 0.8, X3 = 100, X4 = 1.5)
AprParamT <- TransfoParam_GR4J(AprParamR, "RT")

## Single efficiency criterion: GAPX with a priori parameters
69
70
71
72
73
InputsCrit <- CreateInputsCrit(ErrorCrit_GAPX,
                               InputsModel,
                               RunOptions,
                               Obs = AprParamT,
                               VarObs = "ParamT")
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
ErrorCrit <- ErrorCrit_GAPX(InputsCrit, OutputsModel)
str(ErrorCrit)
}


\author{
David Dorchies
}

\references{
De Lavenne, A., Andréassian, V., Thirel, G., Ramos, M.-H., Perrin, C., 2019. A Regularization Approach to Improve the Sequential Calibration of a Semidistributed Hydrological Model. Water Resources Research 55, 8821–8839. \url{https://doi.org/10.1029/2018WR024266}
}

\seealso{
\code{\link{CreateInputsCrit}}, \code{\link{ErrorCrit_RMSE}}, \code{\link{ErrorCrit_NSE}},
\code{\link{ErrorCrit_KGE}}, \code{\link{ErrorCrit_KGE2}}
}